Example #1
0
        private void QuitWithAgentConnectionError(RPCAgent rpcAgent)
        {
            var screen = Widget.Find <BlockSyncLoadingScreen>();

            if (screen.IsActive())
            {
                screen.Close();
            }

            // FIXME 콜백 인자를 구조화 하면 타입 쿼리 없앨 수 있을 것 같네요.
            if (Agent is Agent _)
            {
                var errorMsg = string.Format(L10nManager.Localize("UI_ERROR_FORMAT"),
                                             L10nManager.Localize("BLOCK_DOWNLOAD_FAIL"));

                Widget.Find <SystemPopup>().Show(
                    L10nManager.Localize("UI_ERROR"),
                    errorMsg,
                    L10nManager.Localize("UI_QUIT"),
                    false
                    );

                return;
            }

            if (rpcAgent is null)
            {
                // FIXME: 최신 버전이 뭔지는 Agent.EncounrtedHighestVersion 속성에 들어있으니, 그걸 UI에서 표시해줘야 할 듯?
                // AppProtocolVersion? newVersion = _agent is Agent agent ? agent.EncounteredHighestVersion : null;
                Widget.Find <UpdatePopup>().Show();
                return;
            }

            if (rpcAgent.Connected)
            {
                // 무슨 상황이지?
                Debug.Log($"{nameof(QuitWithAgentConnectionError)}() called. But {nameof(RPCAgent)}.Connected is {rpcAgent.Connected}.");
                return;
            }

            Widget.Find <SystemPopup>().Show(
                "UI_ERROR",
                "UI_ERROR_RPC_CONNECTION",
                "UI_QUIT"
                );
        }
Example #2
0
        private static void OnRPCAgentRetryAndPreloadEnded(RPCAgent rpcAgent)
        {
            if (Widget.Find <Intro>().IsActive() ||
                Widget.Find <PreloadingScreen>().IsActive() ||
                Widget.Find <Synopsis>().IsActive())
            {
                // NOTE: 타이틀 화면에서 리트라이와 프리로드가 완료된 상황입니다.
                // FIXME: 이 경우에는 메인 로비가 아니라 기존 초기화 로직이 흐르도록 처리해야 합니다.
                return;
            }

            var needToBackToMain  = false;
            var showLoadingScreen = false;
            var widget            = (Widget)Widget.Find <BlockSyncLoadingScreen>();

            if (widget.IsActive())
            {
                widget.Close();
            }

            if (Widget.Find <LoadingScreen>().IsActive())
            {
                Widget.Find <LoadingScreen>().Close();
                widget = Widget.Find <QuestPreparation>();
                if (widget.IsActive())
                {
                    widget.Close(true);
                    needToBackToMain = true;
                }

                widget = Widget.Find <Menu>();
                if (widget.IsActive())
                {
                    widget.Close(true);
                    needToBackToMain = true;
                }
            }
            else if (Widget.Find <StageLoadingScreen>().IsActive())
            {
                Widget.Find <StageLoadingScreen>().Close();

                if (Widget.Find <BattleResult>().IsActive())
                {
                    Widget.Find <BattleResult>().Close(true);
                }

                needToBackToMain  = true;
                showLoadingScreen = true;
            }
            else if (Widget.Find <ArenaBattleLoadingScreen>().IsActive())
            {
                Widget.Find <ArenaBattleLoadingScreen>().Close();
                needToBackToMain = true;
            }
            else if (Widget.Find <MimisbrunnrPreparation>().IsActive())
            {
                Widget.Find <MimisbrunnrPreparation>().Close(true);
                needToBackToMain = true;
            }

            if (!needToBackToMain)
            {
                return;
            }

            ActionRenderHandler.BackToMain(
                showLoadingScreen,
                new UnableToRenderWhenSyncingBlocksException());
        }
Example #3
0
 private static void OnRPCAgentRetryStarted(RPCAgent rpcAgent)
 {
     Widget.Find <BlockSyncLoadingScreen>().Show();
 }