public void OnSelectHeroSkill(int userId, string skillId) { ReadyPlayerSampleInfo readyPlayerSampleInfo = this.TryFindPlayerInfo(userId, null); if (readyPlayerSampleInfo != null) { readyPlayerSampleInfo.selfDefSkillId = skillId; MobaMessageManager.DispatchMsg(ClientC2C.PvpSelectHeroSkill, new ParamSelectHeroSkill(userId, skillId)); } }
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 override void Init() { this._activeSurrenderInfo = null; this.HasAllVoted = false; this.IsPassed = false; MobaMessageManager.RegistMessage(PvpCode.C2P_VoteSurrender, new MobaMessageFunc(this.P2C_VoteSurrender)); MobaMessageManager.RegistMessage(PvpCode.C2P_StartSurrender, new MobaMessageFunc(this.P2C_StartSurrender)); MobaMessageManager.RegistMessage(PvpCode.P2C_SurrenderTakeEffect, new MobaMessageFunc(this.P2C_SurrenderTakeEffect)); MobaMessageManager.RegistMessage((ClientMsg)25040, new MobaMessageFunc(this.OnBattleStart)); }
public WaitInfo(MobaMessageType type, int code, string key, float t) { this._type = type; this._code = code; this._key = key; this._initTime = t; this.Add(); this.ResetStartTime(); MobaMessageManager.RegistMessage(type, code, new MobaMessageFunc(this.OnReceiveMsg)); }
private void Unregister() { MobaMessageManager.UnRegistMessage((ClientMsg)21041, new MobaMessageFunc(this.ActionOnceAddExp)); MobaMessageManager.UnRegistMessage((ClientMsg)21042, new MobaMessageFunc(this.ActionLongAddExp)); MobaMessageManager.UnRegistMessage((ClientMsg)21043, new MobaMessageFunc(this.ActionOnDraw)); MobaMessageManager.UnRegistMessage((ClientMsg)21044, new MobaMessageFunc(this.ActionOnLevelUp)); MobaMessageManager.UnRegistMessage((ClientMsg)23053, new MobaMessageFunc(this.OnOpenView)); MobaMessageManager.UnRegistMessage((ClientMsg)25062, new MobaMessageFunc(this.OnPeerConnected)); MobaMessageManager.UnRegistMessage((ClientMsg)25061, new MobaMessageFunc(this.OnPeerDisconnected)); }
private void OnMsg_SceneManagerLoadComplete(MobaMessage msg) { Debug.Log("*********ClientC2C.SceneManagerLoadComplete"); MobaMessageManager.UnRegistMessage(ClientC2C.SceneManagerLoadComplete, new MobaMessageFunc(this.OnMsg_SceneManagerLoadComplete)); this.allPlayerReady = true; if (this.selfReady && this.allPlayerReady && this.loadingFinish) { base.SetGoOn(); } }
private void UnRegister() { MobaMessageManager.UnRegistMessage((ClientMsg)21037, new MobaMessageFunc(this.ActionOpenLegend)); MobaMessageManager.UnRegistMessage((ClientMsg)21038, new MobaMessageFunc(this.ActionOpenCollect)); MobaMessageManager.UnRegistMessage((ClientMsg)21035, new MobaMessageFunc(this.ActionAddExpBall)); MobaMessageManager.UnRegistMessage((ClientMsg)21034, new MobaMessageFunc(this.ActionUseExp)); MobaMessageManager.UnRegistMessage((ClientMsg)21033, new MobaMessageFunc(this.ActionOpenView)); MobaMessageManager.UnRegistMessage((ClientMsg)23054, new MobaMessageFunc(this.OnOpenView)); MobaMessageManager.UnRegistMessage((ClientMsg)25012, new MobaMessageFunc(this.OnTimeOut)); }
public override void SetManager() { base.SetManager(); MobaMessageManager.RegistMessage(ClientC2C.SceneManagerReady, new MobaMessageFunc(this.OnMsg_SceneManagerReady)); MobaMessageManager.RegistMessage(ClientC2C.SceneManagerLoadComplete, new MobaMessageFunc(this.OnMsg_SceneManagerLoadComplete)); MobaMessageManager.RegistMessage(ClientV2C.PVPLoadView_complete, new MobaMessageFunc(this.OnMsg_PVPLoadView_complete)); GlobalObject.Instance.EnableGameManager(true); GameManager.Instance.StartGame(); this.SendAddProgress(5); }
private void Awake() { if (!this.initFlag) { this.Init(); } Settlement_Summoner.levelUpCount = 0; this.Fx_shuzi = (Resources.Load("Prefab/Effects/UIEffect/Fx_shuzi") as GameObject); this.Fx_playerlvuptx = (Resources.Load("Prefab/Effects/UIEffect/Fx_playerlvuptx") as GameObject); MobaMessageManager.RegistMessage((ClientMsg)23030, new MobaMessageFunc(this.onMsg_show)); }
private void UnRegisterTrigger() { for (int i = 0; i < this.listTrigger2.Count; i++) { TriggerManager2.Instance.RemoveListner(this.listTrigger2[i]); } MobaMessageManager.UnRegistMessage((ClientMsg)26021, new MobaMessageFunc(this.OnControllerClose)); MobaMessageManager.UnRegistMessage((ClientMsg)26022, new MobaMessageFunc(this.OnControllerOpen)); MobaMessageManager.UnRegistMessage((ClientMsg)26024, new MobaMessageFunc(this.OnControllerOpen)); MobaMessageManager.UnRegistMessage((ClientMsg)26023, new MobaMessageFunc(this.OnControllerClose)); }
protected override void StartHighEff() { if (UtilManager.Instance == null) { return; } if (this.data.param1 > 0f) { MobaMessageManager.RegistMessage((ClientMsg)25056, new MobaMessageFunc(this.DoUnitDead)); } }
private void OnMsg_SceneManagerReady(MobaMessage msg) { MobaMessageManager.UnRegistMessage(ClientC2C.SceneManagerReady, new MobaMessageFunc(this.OnMsg_SceneManagerReady)); this.selfReady = true; Debug.Log("*********ClientC2C.SceneManagerReady"); this.SendTargetProgress(100); if (this.selfReady && this.allPlayerReady && this.loadingFinish) { base.SetGoOn(); } }
public void SubmitShowSetting() { MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)26033, new object[] { this.LiveTitleInput.value, this.liveQualityRecord }, 0f); MobaMessageManager.ExecuteMsg(message); base.gameObject.SetActive(false); }
public void ConfirmReport(MobaMessage msg) { bool flag = (bool)msg.Param; if (flag) { this.P_Report.collider.enabled = false; this.P_Report.GetComponent <UIButton>().state = UIButtonColor.State.Disabled; } MobaMessageManager.UnRegistMessage((ClientMsg)21031, new MobaMessageFunc(this.ConfirmReport)); }
private void L2C_ModifyState(MobaMessage msg) { OperationResponse operationResponse = msg.Param as OperationResponse; int num = (int)operationResponse.Parameters[0]; int inNewUid = (int)operationResponse.Parameters[1]; if (num == 1) { MobaMessageManager.DispatchMsg((ClientMsg)23069, new ParamShowSwitchHeroResult(inNewUid, 2), 0f); } }
public void OnSelectHeroSkin(int userId, string skinId) { ReadyPlayerSampleInfo readyPlayerSampleInfo = this.TryFindPlayerInfo(userId, "OnSelectHeroSkin"); if (readyPlayerSampleInfo != null) { readyPlayerSampleInfo.heroSkinId = skinId; HeroSkins.SetHeroSkin(this.GetTeam(userId), this.GetPlayerHero(userId), int.Parse(skinId)); MobaMessageManager.DispatchMsg(ClientC2C.PvpSelectHeroSkin, new ParamSelectHeroSkin(userId, skinId)); } }
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 OnMsg_PVPLoadView_complete(MobaMessage msg) { Debug.Log("*********ClientC2C.PVPLoadView_complete"); MobaMessageManager.UnRegistMessage(ClientV2C.PVPLoadView_complete, new MobaMessageFunc(this.OnMsg_PVPLoadView_complete)); Singleton <SkillView> .Instance.SetGameObjectActive(true); this.loadingFinish = true; if (this.selfReady && this.allPlayerReady && this.loadingFinish) { base.SetGoOn(); } }
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); }
/// <summary> /// 更新完时间,进行消息pvp server msg处理 /// </summary> private void ProcessMsgAfterUpdateTime() { while (true) { MobaMessage mobaMessage = this.self.FetchPvpServerMsg(); if (mobaMessage == null) { break; } MobaMessageManager.ExecuteMsg(mobaMessage); } }
private void TryUpdateInfo(ActiveSurrenderInfo info) { TeamType teamType = this.IsLm(info); if (Singleton <PvpManager> .Instance.SelfTeamType == teamType && SurrenderMgr.IsVisible(info)) { this._activeSurrenderInfo = info; this.HasAllVoted = (info.validVoters.Count == info.votes.Count); CtrlManager.OpenWindow(WindowID.SurrenderView, null); MobaMessageManager.DispatchMsg((ClientMsg)23064, info, 0f); } }
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); } }
private void Start() { if (BgmPlayer.exbgmobject1 == null) { BgmPlayer.exbgmobject1 = new GameObject(); BgmPlayer.exbgmobject1.transform.parent = AudioMgr.Instance.gameObject.transform; UnityEngine.Object.DontDestroyOnLoad(BgmPlayer.exbgmobject1); BgmPlayer.exbgmobject1.transform.position = base.gameObject.transform.position; } MobaMessageManager.RegistMessage((ClientMsg)25009, new MobaMessageFunc(this.LoadSceneComplete)); MobaMessageManager.RegistMessage((ClientMsg)25010, new MobaMessageFunc(this.ResetListenerTrans)); }
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 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 UnitsSnapReporter() { this._client = NetWorkHelper.Instance.client; this._coroutineManager = new CoroutineManager(); this._lastSnapTimestamp = 0f; this._snapSendIntervalInSecond = 0.1f; MobaMessageManager.RegistMessage(PvpCode.C2P_Ping, new MobaMessageFunc(this.OnP2C_Ping)); MobaMessageManager.RegistMessage(PvpCode.P2C_CheckPing, new MobaMessageFunc(this.OnP2C_CheckPing)); MobaMessageManager.RegistMessage((ClientMsg)20008, delegate(MobaMessage msg) { this.OnDisconnect(); }); }
public void ApplyChange() { List <ItemDynData> equipList = this.EquipList; IEnumerable <string> source = from x in equipList select x.typeId; List <string> equips = source.ToList <string>(); BattleEquipTools_op.ApplyEquipsToHero(equips, (Hero)this.self); this.self.SetItemSkill(this.EquipList); HeroItemsChangedData msgParam = new HeroItemsChangedData(this.self.unique_id, equipList); MobaMessageManager.DispatchMsg(MobaMessageManager.GetMessage((ClientMsg)25043, msgParam, 0f)); }
private void SaveCurrentState(BattleRoomInfo roomInfo, PvpStartGameInfo loginInfo, ReadyPlayerSampleInfo[] playerInfos) { this._roomId = roomInfo.roomId; Singleton <PvpManager> .Instance.LoginInfo = loginInfo; Singleton <PvpManager> .Instance.ServerBattleRoomInfo = roomInfo; Singleton <PvpManager> .Instance.SetBattleInfoWithoutJoinType(roomInfo.battleId); Singleton <PvpManager> .Instance.SetRoomInfo(roomInfo, -2147483648, playerInfos, ToolsFacade.Instance.GetSummIdByUserid(long.Parse(this._userId)).ToString()); NetWorkHelper.Instance.DisconnectFromGateServer(false); NetWorkHelper.Instance.ConnectToPvpServer(); MobaMessageManager.RegistMessage((ClientMsg)20007, new MobaMessageFunc(this.OnConnectPvp)); }