public static void RemoveListener_preHandler(MobaMasterCode code, MobaMessageFunc func) { if (MVC_MessageManager.dicMabaMasterPreHandler.ContainsKey(code) && func != null && MVC_MessageManager.dicMabaMasterPreHandler[code] != null && MVC_MessageManager.dicMabaMasterPreHandler[code].Contains(func)) { MVC_MessageManager.dicMabaMasterPreHandler[code].Remove(func); } }
private void DelePhotonMsgMasterCode(MobaMasterCode msgID, object msgParam) { MobaMessage message = MobaMessageManager.GetMessage(msgID, msgParam, 0f); if (MobaMessageManager.IsHandlerExists(message)) { MobaMessageManager.ExecuteMsg(message); } }
private static void PreHandler(MobaMasterCode code, MobaMessage msg) { if (MVC_MessageManager.dicMabaMasterPreHandler.ContainsKey(code)) { foreach (MobaMessageFunc current in MVC_MessageManager.dicMabaMasterPreHandler[code]) { current(msg); } } }
public static void AddListener_preHandler(MobaMasterCode code, MobaMessageFunc func) { if (func == null) { return; } if (!MVC_MessageManager.dicMabaMasterPreHandler.ContainsKey(code)) { MVC_MessageManager.dicMabaMasterPreHandler.Add(code, new List <MobaMessageFunc>()); } if (!MVC_MessageManager.dicMabaMasterPreHandler[code].Contains(func)) { MVC_MessageManager.dicMabaMasterPreHandler[code].Add(func); } }
protected override void OnGetMsg(MobaMessage msg) { base.DebugMessage = ((base.LastError != 0) ? "===>服务器列表信息获取失败" : "===>服务器列表信息获取成功"); if (msg != null) { OperationResponse operationResponse = msg.Param as OperationResponse; if (operationResponse != null) { base.LastMsgType = (int)msg.MessageType; base.LastMsgID = msg.ID; int num; MobaMessageType mobaMessageType = MVC_MessageManager.ClientMsg_to_RawCode((ClientMsg)msg.ID, out num); MobaMessageType mobaMessageType2 = mobaMessageType; if (mobaMessageType2 != MobaMessageType.MasterCode) { if (mobaMessageType2 == MobaMessageType.GameCode) { MobaGameCode mobaGameCode = (MobaGameCode)num; if (mobaGameCode == MobaGameCode.Login) { this.OnGetMsg_GameCode_Login(operationResponse); } } } else { MobaMasterCode mobaMasterCode = (MobaMasterCode)num; if (mobaMasterCode != MobaMasterCode.SelectGameArea) { if (mobaMasterCode == MobaMasterCode.GetAllGameServers) { this.OnGetMsg_MasterCode_GetAllGameServers(operationResponse); } } else { this.OnGetMsg_MasterCode_SelectGameArea(operationResponse); } } } } base.TriggerListners(); }
protected override void OnGetMsg(MobaMessage msg) { base.DebugMessage = ((base.LastError != 0) ? "===>天赋的信息获取失败" : "===>天赋的信息获取成功"); if (msg != null) { OperationResponse operationResponse = msg.Param as OperationResponse; if (operationResponse != null) { MobaMasterCode mobaMasterCode = MVC_MessageManager.NotifyModel_to_Master((ClientMsg)msg.ID); base.LastMsgType = (int)mobaMasterCode; MobaMasterCode mobaMasterCode2 = mobaMasterCode; if (mobaMasterCode2 == MobaMasterCode.UpgradeUrl) { this.UpgradeUrl(operationResponse); } } } base.Valid = (base.LastError == 0 && null != base.Data); base.TriggerListners(); }
protected override void OnGetMsg(MobaMessage msg) { MobaMasterCode mobaMasterCode = MVC_MessageManager.NotifyModel_to_Master((ClientMsg)msg.ID); MobaMasterCode mobaMasterCode2 = mobaMasterCode; switch (mobaMasterCode2) { case MobaMasterCode.Login: this.OnGetMsg_MasterCode_Login(msg); goto IL_82; case MobaMasterCode.HulaiLogin: case MobaMasterCode.LoginOut: case MobaMasterCode.GuestUpgradeToOfficial: IL_2E: if (mobaMasterCode2 == MobaMasterCode.Register) { this.OnGetMsg_MasterCode_Register(msg); goto IL_82; } if (mobaMasterCode2 != MobaMasterCode.GuestUpgrade) { goto IL_82; } this.OnGetMsg_MasterCode_GuestUpgrade(msg); goto IL_82; case MobaMasterCode.LoginByPlatformUid: this.OnGetMsg_MasterCode_LoginByPlatformUid(msg); goto IL_82; case MobaMasterCode.LoginByChannelId: this.OnGetMsg_MasterCode_LoginByPlatformUid(msg); goto IL_82; } goto IL_2E; IL_82: base.TriggerListners(); }
public static void UnRegistMessage(MobaMasterCode msgID, MobaMessageFunc msgFunc) { MobaMessageManager.UnRegistMessage(MobaMessageType.MasterCode, (int)msgID, msgFunc); }
public static MobaMessage GetMessage(MobaMasterCode msgID, object msgParam, float delayTime = 0f) { return(new MobaMessage(MobaMessageType.MasterCode, (int)msgID, msgParam, delayTime, null)); }
public static ClientMsg Master_to_NotifyView(MobaMasterCode code) { return(ClientMsg.NotifyView_master_begin + (int)code); }
public static void RemoveListener_view(MobaMasterCode code, MobaMessageFunc func) { MobaMessageManager.UnRegistMessage(MVC_MessageManager.Master_to_NotifyView(code), func); }
public static void AddListener_model(MobaMasterCode code, MobaMessageFunc func) { MobaMessageManager.RegistMessage(MVC_MessageManager.Master_to_NotifyModel(code), func); }