예제 #1
0
 private void OpenYesNoDialog(Error msg_id, Action <string> callback)
 {
     GameSceneEvent.PushStay();
     MonoBehaviourSingleton <GameSceneManager> .I.OpenCommonDialog(new CommonDialog.Desc(CommonDialog.TYPE.YES_NO, StringTable.GetErrorMessage((uint)msg_id), StringTable.Get(STRING_CATEGORY.COMMON_DIALOG, 110u), StringTable.Get(STRING_CATEGORY.COMMON_DIALOG, 112u), null, null), delegate(string ret)
     {
         GameSceneEvent.PopStay();
         callback(ret);
     }, true, 0);
 }
예제 #2
0
 private void OpenMessageDialog(Error msg_id, Action <string> callback)
 {
     GameSceneEvent.PushStay();
     MonoBehaviourSingleton <GameSceneManager> .I.OpenCommonDialog(new CommonDialog.Desc(CommonDialog.TYPE.OK, StringTable.GetErrorMessage((uint)msg_id), null, null, null, null), delegate(string ret)
     {
         GameSceneEvent.PopStay();
         callback(ret);
     }, true, 0);
 }
예제 #3
0
 private static void OpenMaintenancePopup <T>(T ret) where T : BaseModel
 {
     GameSceneEvent.PushStay();
     MonoBehaviourSingleton <GameSceneManager> .I.OpenCommonDialog(new CommonDialog.Desc(CommonDialog.TYPE.YES_NO, StringTable.GetErrorMessage(1002u), StringTable.Get(STRING_CATEGORY.ERROR_DIALOG, 100202u), StringTable.Get(STRING_CATEGORY.ERROR_DIALOG, 100201u), null, ret.infoError), delegate(string btn)
     {
         if (btn == "YES")
         {
             Native.OpenURL("https://www.facebook.com/DragonProject/");
         }
         GameSceneEvent.PopStay();
         MonoBehaviourSingleton <AppMain> .I.Reset();
         Native.applicationQuit();
     }, true, ret.error);
 }
예제 #4
0
 protected static void PushStayEvent()
 {
     GameSceneEvent.PushStay();
 }
예제 #5
0
    private static bool End <T>(T ret, Action <T> call_back, Action retry_action) where T : BaseModel
    {
        SetBusy(-1);
        int  code = ret.error;
        bool flag = MonoBehaviourSingleton <UIManager> .IsValid() && MonoBehaviourSingleton <UIManager> .I.IsTutorialErrorResend();

        if (code == 0)
        {
            if (flag)
            {
                GameSceneEvent.PopStay();
            }
            if (Utility.IsExist(ret.diff) && MonoBehaviourSingleton <ProtocolManager> .IsValid())
            {
                MonoBehaviourSingleton <ProtocolManager> .I.OnDiff(ret.diff[0]);
            }
            return(true);
        }
        if (code < 100000)
        {
            bool flag2 = false;
            switch (code)
            {
            case 1002:
            case 1003:
            case 1020:
            case 1023:
            case 2001:
                flag2 = true;
                break;
            }
            if ((!flag2 || ret is CheckRegisterModel) && GameSceneGlobalSettings.IsNonPopupError(ret))
            {
                if (code == 1002)
                {
                    OpenMaintenancePopup(ret);
                }
                return(true);
            }
            string errorMessage = StringTable.GetErrorMessage((uint)code);
            MonoBehaviourSingleton <GoWrapManager> .I.trackEvent("error_code_" + code, "Error");

            if (flag2 && code != 1002)
            {
                GameSceneEvent.PushStay();
                MonoBehaviourSingleton <GameSceneManager> .I.OpenCommonDialog(new CommonDialog.Desc(CommonDialog.TYPE.YES_NO, errorMessage, null, null, null, null), delegate
                {
                    GameSceneEvent.PopStay();
                    if (code == 1003)
                    {
                        Native.launchMyselfMarket();
                    }
                    MonoBehaviourSingleton <AppMain> .I.Reset();
                }, true, code);
            }
            else if (flag2 && code == 1002)
            {
                OpenMaintenancePopup(ret);
            }
            else if (!MonoBehaviourSingleton <GameSceneManager> .I.isChangeing && !flag)
            {
                GameSceneEvent.PushStay();
                MonoBehaviourSingleton <GameSceneManager> .I.OpenCommonDialog(new CommonDialog.Desc(CommonDialog.TYPE.OK, errorMessage, null, null, null, null), delegate
                {
                    GameSceneEvent.PopStay();
                    call_back(ret);
                    if (code == 74001 || code == 74002)
                    {
                        Debug.Log((object)"kciked");
                        MonoBehaviourSingleton <AppMain> .I.ChangeScene(string.Empty, "HomeTop", delegate
                        {
                            MonoBehaviourSingleton <GuildManager> .I.UpdateGuild(null);
                        });
                    }
                }, true, code);
            }
            else
            {
                if (flag && GameSceneEvent.IsStay())
                {
                    GameSceneEvent.PushStay();
                }
                if (code == 74001 || code == 74002)
                {
                    MonoBehaviourSingleton <GameSceneManager> .I.OpenCommonDialog(new CommonDialog.Desc(CommonDialog.TYPE.OK, errorMessage, null, null, null, null), delegate
                    {
                        GameSceneEvent.PopStay();
                        call_back(ret);
                        if (code == 74001 || code == 74002)
                        {
                            MonoBehaviourSingleton <AppMain> .I.Reset();
                        }
                    }, true, code);
                }
                else
                {
                    MonoBehaviourSingleton <GameSceneManager> .I.OpenCommonDialog(new CommonDialog.Desc(CommonDialog.TYPE.YES_NO, errorMessage, StringTable.Get(STRING_CATEGORY.COMMON_DIALOG, 110u), StringTable.Get(STRING_CATEGORY.COMMON_DIALOG, 111u), null, null), delegate(string btn)
                    {
                        if (btn == "YES")
                        {
                            retry_action();
                        }
                        else
                        {
                            MonoBehaviourSingleton <AppMain> .I.Reset();
                        }
                    }, true, code);
                }
            }
            return(false);
        }
        if (code == 200000)
        {
            MonoBehaviourSingleton <GoWrapManager> .I.trackEvent("error_200000", "Functionality");
        }
        else
        {
            MonoBehaviourSingleton <GoWrapManager> .I.trackEvent("error_code_" + code, "Error");
        }
        string text = StringTable.Format(STRING_CATEGORY.COMMON_DIALOG, 1001u, code);

        GameSceneEvent.PushStay();
        if (code == 129903)
        {
            text = StringTable.Format(STRING_CATEGORY.ERROR_DIALOG, 72003u, code);
            MonoBehaviourSingleton <GameSceneManager> .I.OpenCommonDialog(new CommonDialog.Desc(CommonDialog.TYPE.OK, text, null, null, null, null), delegate
            {
                GameSceneEvent.PopStay();
                call_back(ret);
            }, true, code);
        }
        else if (code > 500000 && code < 600000)
        {
            text = StringTable.Format(STRING_CATEGORY.ERROR_DIALOG, (uint)code, code);
            MonoBehaviourSingleton <GameSceneManager> .I.OpenCommonDialog(new CommonDialog.Desc(CommonDialog.TYPE.OK, text, null, null, null, null), delegate
            {
                GameSceneEvent.PopStay();
                call_back(ret);
            }, true, code);
        }
        else if (code > 600000 && code < 700000)
        {
            text = StringTable.Format(STRING_CATEGORY.ERROR_DIALOG, (uint)code, code);
            MonoBehaviourSingleton <GameSceneManager> .I.OpenCommonDialog(new CommonDialog.Desc(CommonDialog.TYPE.YES_NO, text, StringTable.Get(STRING_CATEGORY.COMMON_DIALOG, 110u), StringTable.Get(STRING_CATEGORY.COMMON_DIALOG, 111u), null, null), delegate(string btn)
            {
                GameSceneEvent.PopStay();
                if (btn == "YES")
                {
                    retry_action();
                }
                else
                {
                    MonoBehaviourSingleton <AppMain> .I.Reset();
                }
            }, true, code);
        }
        else
        {
            MonoBehaviourSingleton <GameSceneManager> .I.OpenCommonDialog(new CommonDialog.Desc(CommonDialog.TYPE.YES_NO, text, StringTable.Get(STRING_CATEGORY.COMMON_DIALOG, 110u), StringTable.Get(STRING_CATEGORY.COMMON_DIALOG, 111u), null, null), delegate(string btn)
            {
                GameSceneEvent.PopStay();
                if (btn == "YES")
                {
                    retry_action();
                }
                else
                {
                    MonoBehaviourSingleton <AppMain> .I.Reset();
                }
            }, true, code);
        }
        return(false);
    }