protected void TriggerListners() { CommonModelNotifyParam notifyData = this.GetNotifyData(); MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)this.modelType, notifyData, 0f); MobaMessageManager.ExecuteMsg(message); }
private void OnGetMsg_GameCode_GetMagicBottleInfo(MobaMessage msg) { base.LastError = 505; OperationResponse operationResponse; if (this.PreHandel(msg, out operationResponse)) { base.LastError = (int)operationResponse.Parameters[1]; if (base.LastError == 0) { MagicBottleData magicBottleData = SerializeHelper.Deserialize <MagicBottleData>(operationResponse.Parameters[236] as byte[]); MagicBottleData magicBottleData2 = base.Data as MagicBottleData; if (magicBottleData != null) { magicBottleData2 = magicBottleData; base.Data = magicBottleData2; Dictionary <string, SysMagicbottleExpVo> typeDicByType = BaseDataMgr.instance.GetTypeDicByType <SysMagicbottleExpVo>(); uint num = this.Level_Check(uint.Parse(magicBottleData2.curlevel.ToString()), typeDicByType); if (!typeDicByType.ContainsKey(num.ToString())) { Debug.LogError("小魔瓶的等级范围在字典中不存在,DK找策划看看。"); } else { Model_BottleSystem.Exp_Max = typeDicByType[num.ToString()].exp; Model_BottleSystem.extraCost = typeDicByType[num.ToString()].ExtraCost; } } MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)23054, magicBottleData2, 0f); MobaMessageManager.ExecuteMsg(message); } } base.TriggerListners(); }
public void ResetPage() { this.ButtonLabel.text = LanguageManager.Instance.GetStringById("LiveorPlayback_Playback003", "Edit"); MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)26030, false, 0f); MobaMessageManager.ExecuteMsg(message); }
private void LoginServer(string editusername, string editpassworld, byte LoginType) { AccountData accountData = new AccountData { Mail = editusername, UserName = editusername, Password = editpassworld, ChannelId = "1" }; ModelManager.Instance.Set_accountData_X(accountData); if (this.toggle.value) { PlayerPrefs.SetString("SavePassWord", "true"); } else { PlayerPrefs.SetString("SavePassWord", "false"); } if (LoginType == 1) { MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)21006, accountData, 0f); MobaMessageManager.ExecuteMsg(message); } else if (LoginType == 2) { MobaMessage message2 = MobaMessageManager.GetMessage((ClientMsg)21004, accountData, 0f); MobaMessageManager.ExecuteMsg(message2); } else if (LoginType == 3) { MobaMessage message3 = MobaMessageManager.GetMessage((ClientMsg)21005, accountData, 0f); MobaMessageManager.ExecuteMsg(message3); } }
private void callback_Ready(IVedioController player) { MsgData_VedioCallback msgParam = new MsgData_VedioCallback(player.ID, player.Resource); MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)25014, msgParam, 0f); MobaMessageManager.ExecuteMsg(message); }
private void onSubmit(GameObject obj = null) { this.data.iparam = Convert.ToInt32(this.fontStyle.text); this.data.timeVal = Convert.ToInt32(this.lifeTime.text); this.data.Content = this.inputContentArea.text; MobaMessageManager.ExecuteMsg(MobaMessageManager.GetMessage((ClientMsg)23066, this.data, 0f)); }
public static void SetSkillPanelPivot(SkillPanelPivot _param) { MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)26020, _param, 0f); MobaMessageManager.ExecuteMsg(message); Singleton <HUDModuleManager> .Instance.SetSkillPanelPivot(_param); }
private void OnGetMsg_UsingEquipment(OperationResponse res) { base.LastError = (int)res.Parameters[1]; List <EquipmentInfoData> list = (List <EquipmentInfoData>)base.Data; if (base.LastError == 0) { string value = res.Parameters[93] as string; long eid = Convert.ToInt64(value); EquipmentInfoData equipmentInfoData = list.Find((EquipmentInfoData obj) => obj.EquipmentId == eid); int modelId = equipmentInfoData.ModelId; if (equipmentInfoData != null && equipmentInfoData.Count > 1) { equipmentInfoData.Count--; } else { list.Remove(equipmentInfoData); } MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)23040, modelId, 0f); MobaMessageManager.ExecuteMsg(message); base.DebugMessage = "====>OK " + res.OperationCode; } else { Singleton <TipView> .Instance.ShowViewSetText("网络数据错误", 1f); base.DebugMessage = "====>UsingEquipment" + res.OperationCode; } base.Valid = (base.LastError == 0); }
private void OnGetMsg_DischargeRune(OperationResponse res) { base.LastError = (int)res.Parameters[1]; List <EquipmentInfoData> list = (List <EquipmentInfoData>)base.Data; int num = (int)res.Parameters[109]; if (base.LastError == 0) { int num2 = num; if (num2 != 1) { if (num2 == 2) { List <EquipmentInfoData> listEquip = SerializeHelper.Deserialize <List <EquipmentInfoData> >(res.Parameters[84] as byte[]); if (list != null && listEquip.Count > 0) { int i; for (i = 0; i < listEquip.Count; i++) { EquipmentInfoData equipmentInfoData = list.Find((EquipmentInfoData obj) => obj.EquipmentId == listEquip[i].EquipmentId); if (equipmentInfoData != null) { equipmentInfoData.Count++; } else { list.Add(listEquip[i]); } } MobaMessageManagerTools.SendClientMsg(ClientC2V.RunesAllDemountEquip, null, false); } } } else { EquipmentInfoData equipmentInfoData2 = SerializeHelper.Deserialize <EquipmentInfoData>(res.Parameters[90] as byte[]); long eid = equipmentInfoData2.EquipmentId; EquipmentInfoData equipmentInfoData3 = list.Find((EquipmentInfoData obj) => obj.EquipmentId == eid); if (equipmentInfoData3 != null) { equipmentInfoData3.Count++; } else { list.Add(equipmentInfoData2); } MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)23041, equipmentInfoData2, 0f); MobaMessageManager.ExecuteMsg(message); base.DebugMessage = "====>OK " + res.OperationCode; } } else { Singleton <TipView> .Instance.ShowViewSetText("网络数据错误", 1f); base.DebugMessage = "====>Demount" + res.OperationCode; } base.Valid = (base.LastError == 0); }
private void OnClick_Delete(GameObject obj = null) { this.deleteBtnFlag = !this.deleteBtnFlag; this.ButtonLabel.text = ((!this.deleteBtnFlag) ? LanguageManager.Instance.GetStringById("LiveorPlayback_Playback003", "Edit") : LanguageManager.Instance.GetStringById("LiveorPlayback_Playback004", "Finish")); MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)26030, this.deleteBtnFlag, 0f); MobaMessageManager.ExecuteMsg(message); }
private void DelePhotonMsgGameCode(MobaGameCode msgID, object msgParam) { MobaMessage message = MobaMessageManager.GetMessage(msgID, msgParam, 0f); if (MobaMessageManager.IsHandlerExists(message)) { MobaMessageManager.ExecuteMsg(message); } }
/// <summary> /// master连接成功回调处理 /// </summary> /// <param name="cType"></param> public override void OnConnected(MobaConnectedType cType) { if (cType != MobaConnectedType.ExceptionOnConnect) { this.ConnectFlag = true; MobaMessageManagerTools.EndWaiting_manual("ConnectMasterServer"); MobaMessageManager.ExecuteMsg(MobaMessageManager.GetMessage((ClientMsg)20003, cType, 0f)); } }
public override void OnDisconnected(MobaDisconnectedType dType) { this.ConnectFlag = false; MobaMessageManager.ExecuteMsg(MobaMessageManager.GetMessage((ClientMsg)20010, dType, 0f)); if (this._enable && GateReconnection.CanTrigger && NetWorkHelper.Instance.GateReconnection.State == GateReconnection.ConnectState.End) { NetWorkHelper.Instance.GateReconnection.Begin(); } }
public void Exit() { MobaMessageManager.ExecuteMsg(ClientC2C.PvpStateExit, this.StateCode, 0f); this.OnExit(); this.UnregistCallbacks(); GateReconnection.OnConnectedEvent -= new Action(this.GateServer_OnConnected); MobaMessageManager.UnRegistMessage((ClientMsg)20001, new MobaMessageFunc(this.OnConnect)); MobaMessageManager.UnRegistMessage((ClientMsg)20002, new MobaMessageFunc(this.OnDisconnect)); this.RegMsgs(new PvpStateBase.MsgRegFn(MobaMessageManager.UnRegistMessage), new PvpStateBase.MsgRegFnLobby(MobaMessageManager.UnRegistMessage)); }
public void SubmitShowSetting() { MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)26033, new object[] { this.LiveTitleInput.value, this.liveQualityRecord }, 0f); MobaMessageManager.ExecuteMsg(message); base.gameObject.SetActive(false); }
private static void TryUpdateCd(int senderId, TeamSignalType signalType) { if (senderId == Singleton <PvpManager> .Instance.MyLobbyUserId) { TeamSignalManager._cdKeeper.Trigger(); if (TeamSignalManager._cdKeeper.IsCd()) { MobaMessageManager.ExecuteMsg(ClientC2C.TeamSignalCoolDown, null, 0f); } } }
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); }
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 ClickReport(GameObject _obj = null) { object[] msgParam = new object[] { this.mPlayerData, this._IsAlly }; MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)21030, msgParam, 0f); MobaMessageManager.ExecuteMsg(message); MobaMessageManager.RegistMessage((ClientMsg)21031, new MobaMessageFunc(this.ConfirmReport)); }
private void DelePhotonMsgCustom(Photon2ClientMsg msgID, object msgParam) { if (PvpServer.IsMultithreadEnabled) { this._storage.AddMsg((int)msgID, msgParam, MsgType.NotifyMsg, 0L); } else { MobaMessage message = MobaMessageManager.GetMessage(msgID, msgParam, 0f); MobaMessageManager.ExecuteMsg(message); } }
/// <summary> /// 更新完时间,进行消息pvp server msg处理 /// </summary> private void ProcessMsgAfterUpdateTime() { while (true) { MobaMessage mobaMessage = this.self.FetchPvpServerMsg(); if (mobaMessage == null) { break; } MobaMessageManager.ExecuteMsg(mobaMessage); } }
private void OnGetMsg_GameCode_DrawMagicBottleAward(MobaMessage msg) { base.LastError = 505; OperationResponse operationResponse; if (this.PreHandel(msg, out operationResponse)) { base.LastError = (int)operationResponse.Parameters[1]; if (base.LastError == 0) { List <DropItemData> list = new List <DropItemData>(); List <EquipmentInfoData> list2 = new List <EquipmentInfoData>(); List <HeroInfoData> list3 = new List <HeroInfoData>(); if (operationResponse.Parameters.ContainsKey(240)) { list = SerializeHelper.Deserialize <List <DropItemData> >(operationResponse.Parameters[240] as byte[]); } if (operationResponse.Parameters.ContainsKey(202)) { list2 = SerializeHelper.Deserialize <List <EquipmentInfoData> >(operationResponse.Parameters[202] as byte[]); } if (operationResponse.Parameters.ContainsKey(88)) { list3 = SerializeHelper.Deserialize <List <HeroInfoData> >(operationResponse.Parameters[88] as byte[]); } int num = (int)operationResponse.Parameters[241]; if (list != null) { this.data.normalDrop = list; } if (list2 != null) { this.data.equipList = list2; } if (list3 != null) { this.data.heroinfoList = list3; } List <DropItemData> list4 = SerializeHelper.Deserialize <List <DropItemData> >(operationResponse.Parameters[146] as byte[]); if (list4 != null && list4.Count != 0) { this.data.repeatDrop = list4; } MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)23051, new List <object> { num, list }, 0f); MobaMessageManager.ExecuteMsg(message); } } }
private void DelePhotonMsgUserDataCode(MobaUserDataCode msgID, object msgParam) { MobaMessage message = MobaMessageManager.GetMessage(msgID, msgParam, 0f); if (MobaMessageManager.IsHandlerExists(message)) { MobaMessageManager.ExecuteMsg(message); } else { ClientLogger.Error("No handler for MobaUserDataCode: " + msgID); } }
private void OnGetMsg_WearPrivateEffect(OperationResponse res) { base.LastError = (int)res.Parameters[1]; List <EquipmentInfoData> list = (List <EquipmentInfoData>)base.Data; if (base.LastError == 0) { int num = (int)res.Parameters[10]; int modelid = (int)res.Parameters[93]; List <EquipmentInfoData> list2 = base.Data as List <EquipmentInfoData>; if (num == 1) { EquipmentInfoData equipmentInfoData = list2.Find((EquipmentInfoData obj) => obj.ModelId == modelid); equipmentInfoData.isweared = 1; if (equipmentInfoData != null && equipmentInfoData.Count > 1) { equipmentInfoData.Count--; } else { list2.Remove(equipmentInfoData); } MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)23058, equipmentInfoData, 0f); MobaMessageManager.ExecuteMsg(message); } if (num == 2) { EquipmentInfoData equipmentinfodata = SerializeHelper.Deserialize <EquipmentInfoData>(res.Parameters[90] as byte[]); EquipmentInfoData equipmentInfoData2 = list2.Find((EquipmentInfoData obj) => obj.EquipmentId == equipmentinfodata.EquipmentId); if (equipmentInfoData2 != null) { equipmentInfoData2.isweared = 1; equipmentInfoData2.Count++; } else { equipmentInfoData2 = equipmentinfodata; list2.Add(equipmentInfoData2); } MobaMessage message2 = MobaMessageManager.GetMessage((ClientMsg)23059, equipmentInfoData2, 0f); MobaMessageManager.ExecuteMsg(message2); } base.Data = list2; base.DebugMessage = "====>OK " + res.OperationCode; } else { base.DebugMessage = "====>Demount" + res.OperationCode; } base.Valid = (base.LastError == 0); }
public static void SendClientMsg(object code, object param = null, bool dispatch = false) { ClientMsg msgID = (ClientMsg)((int)code); MobaMessage message = MobaMessageManager.GetMessage(msgID, param, 0f); if (dispatch) { MobaMessageManager.DispatchMsg(message); } else { MobaMessageManager.ExecuteMsg(message); } }
public void ReceiveMsg(MobaMessage msg) { if (msg.ID == 83 || msg.ID == 72) { MobaMessageManager.ExecuteMsg(msg); return; } if (!FrameSyncManager.Instance.WaitFrameTime) { MobaMessageManager.ExecuteMsg(msg); return; } FrameSyncManager.mMessageQueue.Enqueue(msg); }
protected float SetAttr(DataManager.DataPoolType dataPoolType, AttrType attrType, float value) { if (CharacterDataMgr.instance != null && dataPoolType == DataManager.DataPoolType.CurrentData) { AttrNumberData attrNumberData = CharacterDataMgr.instance.GetAttrNumberData(attrType); if (attrNumberData != null) { if (value > attrNumberData.m_fMaxValue) { value = attrNumberData.m_fMaxValue; } else if (value < attrNumberData.m_fMinValue) { value = attrNumberData.m_fMinValue; } } } this._dataPool[(int)dataPoolType][(int)attrType] = value; if (dataPoolType == DataManager.DataPoolType.CurrentData && this.self.isPlayer) { switch (attrType) { case AttrType.Attack: case AttrType.Armor: case AttrType.MoveSpeed: case AttrType.AttackSpeed: goto IL_AA; case AttrType.DodgeProp: IL_90: switch (attrType) { case AttrType.MagicResist: case AttrType.MagicPower: goto IL_AA; } return(value); } goto IL_90; IL_AA: MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)25057, new MsgData_AttrChangeData { nType = (int)attrType, fValue = value }, 0f); MobaMessageManager.ExecuteMsg(message); } return(value); }
public override void OnConnected(MobaConnectedType cType) { if (cType != MobaConnectedType.ExceptionOnConnect) { this.ConnectFlag = true; if (cType == MobaConnectedType.Original) { this._client.IsReconnect = true; } else if (cType != MobaConnectedType.Multi || NetWorkHelper.Instance.client.IsReconnect) { } MobaMessageManager.ExecuteMsg(MobaMessageManager.GetMessage((ClientMsg)20009, cType, 0f)); } }
public void SetChosen(bool isChosen) { if (isChosen == this._chosenFrame.activeInHierarchy) { return; } this._chosenFrame.SetActive(isChosen); this._serverName.color = ((!isChosen) ? new Color32(156, 242, 253, 255) : new Color32(255, 248, 89, 255)); base.transform.GetComponent <UIButton>().isEnabled = !isChosen; if (isChosen) { object serverName = this.serverName; MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)21002, serverName, 0f); MobaMessageManager.ExecuteMsg(message); } }
public override void OnDisconnected(MobaDisconnectedType dType) { bool flag = this._peer == null; if (flag) { PvpServer.LockScreen(false); } if (this.ConnectFlag) { this.ConnectFlag = false; MobaMessageManager.ExecuteMsg(MobaMessageManager.GetMessage((ClientMsg)20008, dType, 0f)); } this.ConfirmReconnect(); MobaMessageManager.ExecuteMsg(MobaMessageManager.GetMessage((ClientMsg)20002, new PeerDisconnectedMessage(MobaPeerType.C2PvpServer, dType), 0f)); }