private void OnQuery_BlackMarketItemConfirm_YES() { GameSection.StayEvent(); MonoBehaviourSingleton <ShopManager> .I.SendBuyDarkMarket(currentItemChoosed.id, delegate(Error error) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) switch (error) { case Error.None: GameSection.ChangeStayEvent("BUY_SUCCESS", null); this.StartCoroutine("DoReloadMarketData"); break; case Error.ERR_BM_NOT_ENOUGH_GOLD: case Error.ERR_BM_NOT_ENOUGH_GEM: { string errorMessage2 = StringTable.GetErrorMessage((uint)error); GameSection.ChangeStayEvent("BUY_ERROR", errorMessage2); GameSection.ResumeEvent(true, null); break; } case Error.ERR_BM_ITEM_UNAVAILABLE: case Error.ERR_BLACK_MARKET_BUY: case Error.ERR_BM_ITEM_SOLD_OUT: { string errorMessage = StringTable.GetErrorMessage((uint)error); GameSection.ChangeStayEvent("BUY_ERROR", errorMessage); this.StartCoroutine("DoReloadMarketData"); break; } default: GameSection.ResumeEvent(false, null); break; } }); }
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); }
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); }
public void SendCheckRegister(string ntc_data, Action <bool> call_back) { CheckRegisterModel.RequestSendForm requestSendForm = new CheckRegisterModel.RequestSendForm(); requestSendForm.data = ntc_data; Protocol.Send(CheckRegisterModel.URL, requestSendForm, delegate(CheckRegisterModel ret) { switch (ret.Error) { case Error.None: MonoBehaviourSingleton <UserInfoManager> .I.SetRecvUserInfo(ret.result.userInfo, ret.result.tutorialStep); MonoBehaviourSingleton <UserInfoManager> .I.SetNewsID(ret.result.newsId); MonoBehaviourSingleton <UserInfoManager> .I.userIdHash = ret.result.userIdHash; sendAsset = ret.result.sendAsset; if (ret.result.recommendUpdate) { RecommendUpdateCheck(delegate { call_back(true); }); } else if (call_back != null) { call_back(true); } break; case Error.ERR_AUTH_FAILED: if (string.IsNullOrEmpty(account.token)) { if (ret.result.recommendUpdate) { RecommendUpdateCheck(delegate { call_back(false); }); } else if (call_back != null) { call_back(false); } } else { MonoBehaviourSingleton <GameSceneManager> .I.OpenCommonDialog(new CommonDialog.Desc(CommonDialog.TYPE.YES_NO, StringTable.GetErrorMessage((uint)ret.Error), StringTable.Get(STRING_CATEGORY.COMMON_DIALOG, 101u), StringTable.Get(STRING_CATEGORY.COMMON_DIALOG, 102u), null, null), delegate(string btn) { if (btn == "YES") { GameSceneEvent.PopStay(); ResetAccount(); TutorialReadData.SaveAsEmptyData(); SaveAsEmptyData(); MonoBehaviourSingleton <AppMain> .I.Reset(); } else { SendCheckRegister(ntc_data, call_back); } }, true, (int)ret.Error); } break; case Error.WRN_MAINTENANCE: OpenMessageDialog(ret.Error, delegate { MonoBehaviourSingleton <GameSceneManager> .I.OpenInfoDialog(delegate { SendCheckRegister(ntc_data, call_back); }, true); }); break; case Error.WRN_UPDATE_FORCE: OpenMessageDialog(ret.Error, delegate { Native.launchMyselfMarket(); SendCheckRegister(ntc_data, call_back); }); break; case Error.WRN_BAN_USER: OpenMessageDialog(ret.Error, delegate { SendCheckRegister(ntc_data, call_back); }); break; case Error.WRN_RESIGNED_USER: OpenMessageDialog(ret.Error, delegate { SendCheckRegister(ntc_data, call_back); }); break; default: OpenYesNoDialog(ret.Error, delegate(string sel) { if ("YES" == sel) { SendCheckRegister(ntc_data, call_back); } else { Application.Quit(); } }); break; } }, string.Empty); }
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); }
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); }
public void OnTableDownloadError(DataTableLoadError error, Action retry) { if (!showingTableLoadError) { showingTableLoadError = true; Error error2; switch (error) { case DataTableLoadError.AssetNotFoundError: error2 = Error.AssetNotFound; break; case DataTableLoadError.FileWriteError: error2 = Error.AssetSaveFailed; break; case DataTableLoadError.VerifyError: error2 = Error.AssetVerifyFailed; break; default: error2 = Error.AssetLoadFailed; break; } MonoBehaviourSingleton <GameSceneManager> .I.OpenCommonDialog(new CommonDialog.Desc(CommonDialog.TYPE.YES_NO, StringTable.GetErrorMessage((uint)error2), StringTable.Get(STRING_CATEGORY.COMMON_DIALOG, 110u), StringTable.Get(STRING_CATEGORY.COMMON_DIALOG, 111u), null, null), delegate(string btn) { showingTableLoadError = false; if (btn == "YES") { retry(); } else { MonoBehaviourSingleton <AppMain> .I.Reset(); } }, true, (int)error2); } }