void Update() { if ((Input.GetKeyDown(KeyCode.Escape))) { MsgSignal.Dispatch(new MsgPara("确定要退出吗?", 1, () => { Application.Quit(); }, () => { })); } if (Global.LastAppHeartBeatTime != 0 && Global.IsLoginApp) { ulong nowTime = TimeHelper.GetNowTime(); ulong left = nowTime - Global.LastAppHeartBeatTime; if (left > 15) //回包超时跳出提示,重新登录 { Global.LastAppHeartBeatTime = 0; MsgSignal.Dispatch(new MsgPara("网络异常请重新登录", 2)); loginSignal.Dispatch(); } } if (Global.IsLoginApp) //保存最近连接服务器的index { int ipListIndex = PlayerPrefs.GetInt("ipListIndex", -1); if (ipListIndex != Global.AppConnIpsIndex) { PlayerPrefs.SetInt("ipListIndex", Global.AppConnIpsIndex); //保存最近连接服务器的index } } }
public void OnReceive(NetMessageHead head, MSG_GP_USER_GETPLAYPE para) { if (para.iReturn != 0) { MsgSignal.Dispatch(new MsgPara(para.GetChResult(), 2)); } else { Signal.Dispatch(para); } }
void OnLoginSignal(int para) { if (para == -1) { view.close(); } else if (para == 2) { MsgSignal.Dispatch(new MsgPara("用户不存在", 2)); } else if (para == 3) { MsgSignal.Dispatch(new MsgPara("用户不存在或者密码错误", 2)); } else if (para == 4) { MsgSignal.Dispatch(new MsgPara("此账号被禁止登录", 2)); } else if (para == 5) { MsgSignal.Dispatch(new MsgPara("您所在IP地址被禁止登录", 2)); } else if (para == 11) { Global.LastAppHeartBeatTime = 0; //防止网络检查与此处冲突 MsgSignal.Dispatch(new MsgPara("此账号已经在别处登录", 2)); LogoutSignal.Dispatch(); } else if (para == 20) { MsgSignal.Dispatch(new MsgPara("帐号已经在其他机器上锁机", 2)); } else { MsgSignal.Dispatch(new MsgPara("数据异常", 2)); } }
void OnClickIcon(GameObject go) { AudioController.Instance.SoundPlay("active_item"); int lotteryId = int.Parse(go.name); if (lotteryId == 10301800) //百家乐 { string version = null; string updateUrl = null; foreach (ComNameInfo gameInfo in comNameInfoList) { if (lotteryId == (int)gameInfo.uNameID) { version = gameInfo.GetVersion(); updateUrl = gameInfo.GetChdownLoadUrl(); } } if (!Constant.BJL_VERSION.Equals(version)) { MsgSignal.Dispatch(new MsgPara("您的游戏版本过低,\n点击确认下载最新版本", 1, () => { Application.OpenURL(updateUrl); }, () => { })); } else { Global.CurrentGameId = 10301800; NetworkManager.Instance.GetGameRooms(1, 10301800); panelScript.gamelistPanel.SetActive(true); //创建房间列表 } } else //彩票 { OpenSelectView(lotteryId); } }
public void OnReceive(NetMessageHead head, MSG_GP_UER_GETBACKInfo para) { if (para.byGetTypeBack == 10) //下单返回 { if (para.byReturn > 100) { OrdSuccessSignal.Dispatch(); uinfomodel.SetMoney(para.iOutMoney); refreshMoneySignal.Dispatch(); } //应该把这个放这里才对 MsgSignal.Dispatch(new MsgPara(para.GetDesc(), 2)); Loading.GetInstance().HideLoading(); Global.IsAppOrderRsp = true; } else if (para.byGetTypeBack == 5) //追号返回 { if (para.byReturn >= 100) { zhrtnSignal.Dispatch(para.byReturn); } else { MsgSignal.Dispatch(new MsgPara(para.GetDesc(), 2)); } Loading.GetInstance().HideLoading(); } else if (para.byGetTypeBack == 6) //追号返回 { MsgSignal.Dispatch(new MsgPara(para.GetDesc(), 2)); OrdSuccessSignal.Dispatch(); Loading.GetInstance().HideLoading(); } else if (para.byGetTypeBack == 2) //赔率返点返回 { NetworkManager.Instance.GetAward(model.lotteryCfg.lotteryId, model.currentSubMode.subModeId); } else if (para.byGetTypeBack == 8) //追号 取款 { MsgSignal.Dispatch(new MsgPara(para.GetDesc(), 2)); NetworkManager.Instance.RefreshMoney(); } else if (para.byGetTypeBack == 0) //设置密保成功 { MsgSignal.Dispatch(new MsgPara(para.GetDesc(), 2)); } else if (para.byGetTypeBack == 7) // { MsgSignal.Dispatch(new MsgPara(para.GetDesc(), 2)); if (para.byReturn == 0)//等于0的时候成功 { NetworkManager.Instance.RefreshMoney(); chedanSuccessSignal.Dispatch(); } } else if (para.byGetTypeBack == 13 || para.byGetTypeBack == 14) // { MsgSignal.Dispatch(new MsgPara(para.GetDesc(), 2)); if (para.byReturn == 0)//等于0的时候成功 { NetworkManager.Instance.GetSevenDayInfo(); } } else if (para.byGetTypeBack == 12) // { MsgSignal.Dispatch(new MsgPara(para.GetDesc(), 2)); if (para.byReturn == 0)//等于0的时候成功 { NetworkManager.Instance.GetAddMemberInfo(); } } else { MsgSignal.Dispatch(new MsgPara(para.GetDesc(), 2)); } }
void OnRoomMsg(MsgPara para) { MsgSignal.Dispatch(para); }
void OnsubPanelMsg(MsgPara para) { MsgSignal.Dispatch(para); }