private void PromptToRecover() { Action <bool> callback = delegate(bool ok) { if (ok) { base.SendUserBackToGs(); } else { CtrlManager.ShowMsgBox("确认吗?", "您可能会因此受到队友举报或者系统逃跑惩罚", delegate(bool okAgain) { if (okAgain) { Singleton <PvpManager> .Instance.SendLobbyMsg(LobbyCode.C2L_ForceQuitPvp, new object[0]); base.RecoverFinish(new PvpStateHome()); } else { base.SendUserBackToGs(); } }, PopViewType.PopTwoButton, "确认逃跑", "返回战场", null); } }; CtrlManager.ShowMsgBox("提示", "您有一场pvp战斗没有结束,是否继续?", callback, PopViewType.PopTwoButton, "返回战场", "逃跑", null); }
private void ConfirmConnect() { this._confirmed = true; if (this._retryNum < 3) { this.OnClickConnect(); } else { this._disableProgressBarOnce = false; this._retryNum = 0; this.ShowProgress(false); CtrlManager.ShowMsgBox("游戏服务器断开", "网络出故障了,请重试", delegate(bool yes) { if (yes) { this.OnClickConnect(); } else { this.OnClickRestart(); } }, PopViewType.PopTwoButton, "确定", "重启游戏", null); } }
private void ConfirmQuiting(string text, string title = "游戏结束") { CtrlManager.ShowMsgBox(title, text, delegate { this.RecoverFinish(new PvpStateHome()); }, PopViewType.PopOneButton, "确定", "取消", null); }
private void initCallback(string result) { UnityEngine.Debug.Log("fastaccess_Unity initCallback result:" + result); JsonData jsonData = JsonMapper.ToObject(result); int num = (int)jsonData["resultCode"]; if (num == 2) { this.isInit = true; if (this.needLogin) { NetWorkHelper.Instance.GateReconnection.LeaveGame("leave"); HoolaiSDK.instance.login("login"); } else { LoginStateManager.Instance.ChangeState(LoginStateCode.LoginState_Init); } this.needLogin = false; UnityEngine.Debug.Log("fastaccess_Unity init success"); } else { this.isInit = false; UnityEngine.Debug.Log("fastaccess_Unity init fail"); CtrlManager.ShowMsgBox("初始化失败", "是否进行重试?", new Action <bool>(this.AgainCall), PopViewType.PopOneButton, "确定", "取消", null); } }
public void InitModel(string material, string heroID, string npcid) { this.hero_id = npcid; GameObject gameObject = ResourceManager.Load <GameObject>(heroID, true, true, null, 0, false); string text = this.path(gameObject.name); Transform transform = gameObject.transform.FindChild("Model"); Transform transform2 = transform.transform.FindChild(text); if (null == transform2) { CtrlManager.ShowMsgBox("名称不匹配!!!", "Skinnedmeshrender组件的名字(我们不知道是什么) 不匹配Smodel的名字: \"" + text + "\" 也许有人可以修复一下", delegate { }, PopViewType.PopOneButton, "确定", "取消", null); return; } SkinnedMeshRenderer component = transform2.GetComponent <SkinnedMeshRenderer>(); for (int i = 0; i < component.materials.Length; i++) { if (null == component.materials[i] || !component.materials[i].name.Contains(text)) { UnityEngine.Debug.LogError(text + "Still missing materials(perfab),locate at (from 0):" + i); } } if (gameObject != null) { this.InitSModel(gameObject); return; } }
private void ConfirmReconnect() { if (GlobalSettings.NoReConnnect || this._isConfirmCd || this._peer == null) { return; } if (this.ConnectFlag) { this.ReconnectFinish(); return; } if (this._isConfirmingReconnect) { return; } if (PvpServer._autoRetryNum < 5) { PvpServer._autoRetryNum++; PvpServer.LockScreen(true); this.Connect(); } else { CtrlManager.CloseWindow(WindowID.ProgressView); PvpServer._autoRetryNum = 0; this._isConfirmingReconnect = true; CtrlManager.ShowMsgBox(LanguageManager.Instance.GetStringById("ServerResponse_Title_GameServerDisconnect", "游戏服务器断开"), LanguageManager.Instance.GetStringById("ServerResponse_Content_GameServerDisconnect", "网络出故障了,请重试"), new Action <bool>(this.ConnectOrRestart), PopViewType.PopTwoButton, "确定", "重启游戏", null); } }
private void OnClickBlock(GameObject obj1 = null) { if (ModelManager.Instance.Get_blackList_X() != null && ModelManager.Instance.Get_blackList_X().Find((FriendData obj) => obj.TargetId == this.targetSummId) != null) { Singleton <TipView> .Instance.ShowViewSetText("已在黑名单中", 1f); return; } CtrlManager.ShowMsgBox(LanguageManager.Instance.GetStringById("FriendsUI_DialogBox_Title_AddBlackList"), LanguageManager.Instance.GetStringById("FriendsUI_DialogBox_Content_AddBlackList"), new Action <bool>(this.BoolMoveBlack), PopViewType.PopTwoButton, "确定", "取消", null); }
private void FailedTransaction(string s) { UnityEngine.Debug.Log("[MsgFrom ios]FailedTransaction : " + s); if (this.productInfo.Count == 0) { return; } MobaMessageManagerTools.EndWaiting_manual("IAPInBuy"); CtrlManager.ShowMsgBox("提示", "支付不成功,请重试!", new Action <bool>(this.ReComfirm), PopViewType.PopOneButton, "确定", "取消", null); }
private void ShowBox1(string title, string content, Action callback) { CtrlManager.ShowMsgBox("提示", content, delegate { if (callback != null) { callback(); } }, PopViewType.PopOneButton, "确定", "取消", null); }
private void InitData(byte[] data) { if (data != null) { BaseDataMgr.instance.InitBaseConfigData(data); } else { CtrlManager.ShowMsgBox(string.Empty, "配置文件错误!", new Action(this.QuitApp), PopViewType.PopOneButton, "确定", "取消", null); } }
private void OnClick_Delete(GameObject obj) { CtrlManager.ShowMsgBox("删除确认", "确定删除本场战斗回放吗?", delegate(bool _isConfirm) { if (!_isConfirm) { return; } MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)26031, this, 0f); MobaMessageManager.ExecuteMsg(message); }, PopViewType.PopTwoButton, "确定", "取消", null); }
private void OnClick_Play(GameObject obj) { CtrlManager.ShowMsgBox("战场回放", "确定要打开本场战斗回放吗?(加载战斗回放不消耗流量)", delegate(bool _isConfirm) { if (!_isConfirm) { return; } MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)26032, this.ReplayId, 0f); MobaMessageManager.ExecuteMsg(message); }, PopViewType.PopTwoButton, "确定", "取消", null); }
public override void OnDisconnected(MobaDisconnectedType dType) { if (this.ConnectFlag) { this.ConnectFlag = false; } if (this._peer != null) { MobaMessageManagerTools.EndWaiting_manual("ConnectLobby"); CtrlManager.ShowMsgBox("Lobby服务器断开", "网络出故障了,请重试", new Action(this.Connect), PopViewType.PopOneButton, "确定", "取消", null); } }
private void GetRewardDropCallback(int Ret, string DebugMessage) { if (Ret == 0) { this.GetRewardSuccess(); } else { this.GetRewardFail(); ClientLogger.Error("掉落失败"); CtrlManager.ShowMsgBox("提示", "初始化掉落获得错误码,将导致战斗结果提交失败,请呼叫王传伟 Error:" + Ret, null, PopViewType.PopOneButton, "确定", "取消", null); } }
private void OnMsg_DownLoadBinDataOver(MobaMessage msg) { if ((int)msg.Param == 0) { this.bFinish = true; this.DownloadFinish(); } else { string str = ModelManager.Instance.Get_appVersionProperty(); string content = "配置下载失败,请确认重试" + str + ",是否重试"; CtrlManager.ShowMsgBox("糟糕", content, new Action(this.CheckAndDownBinData), PopViewType.PopOneButton, "确定", "取消", null); } }
private void ShowMsgBox(string title, string content, Action del_ok, Action del_cancel, string ok = "确认", string cancel = "取消") { CtrlManager.ShowMsgBox(title, content, delegate(bool ret) { if (ret) { del_ok(); } else { del_cancel(); } }, PopViewType.PopTwoButton, ok, cancel, null); }
private void OnMsg_UpgradeUrl(MobaMessage msg) { OperationResponse operationResponse = msg.Param as OperationResponse; if (operationResponse != null) { int num = (int)operationResponse.Parameters[1]; ClientData clientData = ModelManager.Instance.Get_ClientData_X(); MobaErrorCode mobaErrorCode = (MobaErrorCode)num; if (mobaErrorCode != MobaErrorCode.Ok) { if (mobaErrorCode != MobaErrorCode.SystemError) { string content = "版本验证:获取版本信息失败"; CtrlManager.ShowMsgBox("版本验证", content, delegate { this.tryTime = 0; this.CheckVersion(); }, PopViewType.PopOneButton, "确定", "取消", null); } else { this.tryTime++; ModelManager.Instance.Set_masterForceIp("ios.mobaapp.xiaomeng.cc"); if (this.tryTime > 4) { string content2 = "服务器或者网络出现问题,请重试"; CtrlManager.ShowMsgBox("版本验证", content2, delegate { this.tryTime = 0; NetWorkHelper.Instance.DisconnectFromMasterServer(); NetWorkHelper.Instance.ConnectToMasterServer(); }, PopViewType.PopOneButton, "确定", "取消", null); } else { NetWorkHelper.Instance.DisconnectFromMasterServer(); NetWorkHelper.Instance.ConnectToMasterServer(); } } } else { this.bFinish = true; this.tryTime = 0; this.OnCheckVersionFinish(); } } }
public static UnityEngine.Object Load(string assetPath, string family, bool persistent = false) { if (family == null) { CtrlManager.ShowMsgBox("版本号异常", "VersionInfo没有找到对应的配置文件,或者下载失败", null, PopViewType.PopOneButton, "确定", "取消", null); return(null); } if (!AssetBundleInfo.FamilyInfo.ContainsKey(family)) { return(null); } string bundlePathName = AssetLoader.Instance.m_bundlePath + AssetBundleInfo.FamilyInfo[family].BundleName; return(AssetLoader.Instance.LoadBundle(family, bundlePathName, assetPath, persistent, null, null, null)); }
private void ShowBox2(string title, string content, Action callback, Action callback2) { CtrlManager.ShowMsgBox("提示", content, delegate(bool ret) { if (ret) { if (callback != null) { callback(); } } else if (callback2 != null) { callback2(); } }, PopViewType.PopTwoButton, "确定", "取消", null); }
public Dictionary <string, object> GetDicByType <T>() where T : class { Dictionary <string, object> result; try { result = this.data[typeof(T).Name]; } catch (Exception ex) { ClientLogger.Warn("warn\n" + ex.Message); string content = "配置文件和客户端不匹配,请装新版本,别找wcw!typeof(T).Name= " + typeof(T).Name + ",Info:" + ex.Message; CtrlManager.ShowMsgBox("错误", content, null, PopViewType.PopOneButton, "Shit", "取消", null); return(null); } return(result); }
private void P2C_LoginFight(MobaMessage msg) { RetaMsg probufMsg = msg.GetProbufMsg <RetaMsg>(); byte retaCode = probufMsg.retaCode; PvpStateBase.LogState("===>receive: P2C_LoginFight:" + retaCode); if (retaCode == 0) { Singleton <PvpManager> .Instance.LoadPvpSceneBegin(); PvpStateManager.Instance.ChangeState(new PvpStateLoad()); } else { ClientLogger.Error("P2C_LoginFight: 别怕,帮助@liuchen定位问题,failed for " + (PvpErrorCode)retaCode); CtrlManager.ShowMsgBox("错误", "服务器错误码" + retaCode, new Action(PvpUtils.GoHome), PopViewType.PopOneButton, "确定", "取消", null); } }
private void P2C_LoginAsViewer(MobaMessage msg) { RetaMsg probufMsg = msg.GetProbufMsg <RetaMsg>(); byte retaCode = probufMsg.retaCode; PvpStateBase.LogState("===>receive: P2C_LoginAsViewer:" + retaCode); if (retaCode == 0) { Singleton <PvpManager> .Instance.LoadPvpSceneBegin(); PvpStateManager.Instance.ChangeState(new PvpStateLoad()); } else { ClientLogger.Error("P2C_LoginAsViewer: 别怕,帮助@汪洋定位问题,failed for " + retaCode); CtrlManager.ShowMsgBox("观战失败", "观战失败,游戏已经结束或者没有观战的权限", new Action(PvpUtils.GoHome), PopViewType.PopOneButton, "确定", "取消", null); } }
private void NewbieP2C_LoginFight(MobaMessage msg) { RetaMsg probufMsg = msg.GetProbufMsg <RetaMsg>(); byte retaCode = probufMsg.retaCode; if (retaCode == 0) { NewbieManager.Instance.SetSpecialEnterBattleSuc(); Singleton <PvpManager> .Instance.LoadPvpSceneBegin(); PvpStateManager.Instance.ChangeState(new PvpStateLoad()); } else { ClientLogger.Error("P2C_LoginFight: 别怕,帮助@汪洋定位问题,failed for " + retaCode); CtrlManager.ShowMsgBox("错误", "服务器错误码" + retaCode, new Action(PvpUtils.GoHome), PopViewType.PopOneButton, "确定", "取消", null); } }
private string ParseStringFormat(string s, int[] format) { string text = string.Empty; string[] array = s.Split(new char[] { '|' }); if (array.Length != format.Length) { CtrlManager.ShowMsgBox("mismatch string array length!!!", "the length of string array mismatched the formats'", delegate { }, PopViewType.PopOneButton, "确定", "取消", null); } else { for (int i = 0; i < array.Length; i++) { switch (format[i]) { case 0: array[i] = "[00e0c8]" + array[i] + "[-]"; break; case 1: array[i] = "[ff0054]" + array[i] + "[-]"; break; case 2: array[i] = "[00ff36]" + array[i] + "[-]"; break; case 3: array[i] = "[ffea00]" + array[i] + "[-]"; break; } } for (int j = 0; j < array.Length; j++) { text += array[j]; } } return(text); }
private void On_server_Register(MobaMessage msg) { OperationResponse operationResponse = msg.Param as OperationResponse; if (operationResponse == null) { Singleton <TipView> .Instance.ShowViewSetText("注册失败...系统错误", 1f); LoginStateManager.Instance.ChangeState(LoginStateCode.LoginState_waitLogin); } else { int num = (int)operationResponse.Parameters[1]; MobaErrorCode mobaErrorCode = (MobaErrorCode)num; if (mobaErrorCode != MobaErrorCode.Ok) { if (mobaErrorCode != MobaErrorCode.UserExist) { Singleton <TipView> .Instance.ShowViewSetText("注册失败...系统错误", 1f); LoginStateManager.Instance.ChangeState(LoginStateCode.LoginState_waitLogin); } else { if (!AutoTestController.IsEnable(AutoTestTag.Login)) { CtrlManager.ShowMsgBox("注册失败", "该账号已经被注册,请更换一个账号重新注册", null, PopViewType.PopOneButton, "确定", "取消", null); } LoginStateManager.Instance.ChangeState(LoginStateCode.LoginState_waitLogin); AutoTestController.InvokeTestLogic(AutoTestTag.Login, delegate { Singleton <LoginView_New> .Instance.TestRegisterAgain(); }, 1f); } } else { Singleton <TipView> .Instance.ShowViewSetText("注册成功", 1f); this.bFinish = true; LoginStateManager.Instance.ChangeState(LoginStateCode.LoginState_masterLogin); } } }
protected virtual void P2C_LoginAsViewer(MobaMessage msg) { PvpServer.LockScreen(false); RetaMsg probufMsg = msg.GetProbufMsg <RetaMsg>(); byte retaCode = probufMsg.retaCode; PvpStateBase.LogState("===>receive: P2C_LoginAsViewer:" + retaCode); if (retaCode == 0) { Singleton <PvpManager> .Instance.LoadPvpSceneBegin(); this.RecoverFinish(new PvpStateLoad()); } else { ClientLogger.Error("P2C_LoginAsViewer: failed for " + retaCode); CtrlManager.ShowMsgBox("观战失败", "观战失败,游戏已经结束或者没有观战的权限", new Action(PvpUtils.GoHome), PopViewType.PopOneButton, "确定", "取消", null); } }
private void OnKickOut(MobaMessage msg) { NetWorkHelper.Instance.Enable(false); CtrlManager.ShowMsgBox("重复登录", "英雄,您在别的地方登录了,传送门将关闭", delegate { if (GlobalSettings.isLoginByAnySDK) { InitAnySDK.getInstance().logout(); } else if (GlobalSettings.isLoginByHoolaiSDK) { InitSDK.instance.SDKLogout(true); } else { GlobalObject.ReStartGame(); } }, PopViewType.PopOneButton, "确定", "取消", null); }
private void L2C_TipMessage(MobaMessage msg) { OperationResponse operationResponse = msg.Param as OperationResponse; string text = (string)operationResponse.Parameters[0]; switch (Convert.ToInt32(operationResponse.Parameters[1])) { case 0: Singleton <TipView> .Instance.SetText(text, 0f); CtrlManager.OpenWindow(WindowID.TipView, null); break; case 1: CtrlManager.ShowMsgBox("错误", text, delegate { }, PopViewType.PopOneButton, "确定", "取消", null); break; } }
private void OnDraw(MobaMessage msg) { if (msg == null) { CtrlManager.ShowMsgBox("Null Exception!!!", "'msg' is null. Please check 'OnDraw' method. 'BottleViewBottomRight.cs'.", delegate { }, PopViewType.PopOneButton, "确定", "取消", null); return; } List <object> list = (List <object>)msg.Param; this.typeBottle = (int)list[0]; this.did.Clear(); this.did.AddRange((List <DropItemData>)list[1]); this.times = 0; this.times++; CtrlManager.OpenWindow(WindowID.GetItemsView, null); if (this.did.Count == 0 || this.did == null) { return; } Tools_BottleDrop.ParseDetail(this.did); Tools_BottleDrop.SetModelData(); MobaMessageManagerTools.SendClientMsg(ClientV2C.bottleSystemChangeBottleDraw, null, false); GetItemsView expr_A5 = Singleton <GetItemsView> .Instance; expr_A5.onFinish = (Callback)Delegate.Combine(expr_A5.onFinish, new Callback(this.RefreshDataUI)); if (this.typeBottle != 0) { if (this.typeBottle == 1) { this.CountLegend--; } else { this.CountCollect--; } } }
private void Connect() { if (!this.ConnectFlag) { MobaMessageManagerTools.BeginWaiting_manual("ConnectMasterServer", "连接Master服务器...", false, 1000f, true); if (!SendMsgManager.Instance.ClientConnectToMaster()) { MobaMessageManagerTools.EndWaiting_manual("ConnectMasterServer"); CtrlManager.ShowMsgBox("游戏服务器无法连接", "网络出故障了,请重试", delegate(bool yes) { if (yes) { this.OnHandle_connect(); } else { this.OnHandle_restart(); } }, PopViewType.PopTwoButton, "确定", "重启游戏", null); Debug.LogError("MasterServerNew Connect failed"); } } }