public static void RemoveListener_preHandler(MobaGameCode code, MobaMessageFunc func) { if (MVC_MessageManager.dicMabaGamePreHandler.ContainsKey(code) && func != null && MVC_MessageManager.dicMabaGamePreHandler[code] != null && MVC_MessageManager.dicMabaGamePreHandler[code].Contains(func)) { MVC_MessageManager.dicMabaGamePreHandler[code].Remove(func); } }
protected override void OnGetMsg(MobaMessage msg) { base.LastError = 505; OperationResponse operationResponse = msg.Param as OperationResponse; if (operationResponse != null) { MobaGameCode mobaGameCode = MVC_MessageManager.NotifyModel_to_Game((ClientMsg)msg.ID); MobaGameCode mobaGameCode2 = mobaGameCode; if (mobaGameCode2 != MobaGameCode.BuyShopGoodsNew) { if (mobaGameCode2 != MobaGameCode.SignDay) { if (mobaGameCode2 == MobaGameCode.GetSummSkinList) { this.OnGetMsg_GetSummSkinList(operationResponse); } } else { this.OnGetMsg_SignDay(operationResponse); } } else { this.OnGetMsg_BuyShopGoodsNew(operationResponse); } } }
private void DelePhotonMsgGameCode(MobaGameCode msgID, object msgParam) { MobaMessage message = MobaMessageManager.GetMessage(msgID, msgParam, 0f); if (MobaMessageManager.IsHandlerExists(message)) { MobaMessageManager.ExecuteMsg(message); } }
private static void PreHandler(MobaGameCode code, MobaMessage msg) { if (MVC_MessageManager.dicMabaGamePreHandler.ContainsKey(code)) { foreach (MobaMessageFunc current in MVC_MessageManager.dicMabaGamePreHandler[code]) { current(msg); } } }
protected override void OnGetMsg(MobaMessage msg) { base.DebugMessage = ((base.LastError != 0) ? "===>成就系统信息获取失败" : "===>成就系统信息获取成功"); if (msg != null) { OperationResponse operationResponse = msg.Param as OperationResponse; if (operationResponse != null) { MobaGameCode mobaGameCode = MVC_MessageManager.NotifyModel_to_Game((ClientMsg)msg.ID); base.LastMsgType = (int)mobaGameCode; MobaGameCode mobaGameCode2 = mobaGameCode; switch (mobaGameCode2) { case MobaGameCode.GetTotalRecord: this.GetKdaData(operationResponse); break; case MobaGameCode.GetHistoryRecord: this.GetHistoryData(operationResponse); break; case MobaGameCode.GetHomeTotalRecord: this.GetHomeKDAData(operationResponse); break; case MobaGameCode.GetHeroRecordInfo: this.GetOnePageBattleData(operationResponse); break; default: if (mobaGameCode2 != MobaGameCode.GetKdaMyHeroData) { if (mobaGameCode2 != MobaGameCode.GetMyFightAbility) { if (mobaGameCode2 == MobaGameCode.GetUserHonorPic) { this.GetMyHonorData(operationResponse); } } else { this.GetMyAbilityData(operationResponse); } } else { this.GetAchievementData(operationResponse); } break; } } } base.TriggerListners(); }
protected override void OnGetMsg(MobaMessage msg) { base.LastError = 505; OperationResponse operationResponse = msg.Param as OperationResponse; if (operationResponse != null) { MobaGameCode mobaGameCode = MVC_MessageManager.NotifyModel_to_Game((ClientMsg)msg.ID); MobaGameCode mobaGameCode2 = mobaGameCode; switch (mobaGameCode2) { case MobaGameCode.ShowDailyTask: this.OnGetMsg_GetTaskList(operationResponse); goto IL_9E; case MobaGameCode.GetAchieveTaskAward: this.OnGetMsg_GetReward(operationResponse); goto IL_9E; case MobaGameCode.GetFriendGameServer: case MobaGameCode.GetGameServer: IL_48: switch (mobaGameCode2) { case MobaGameCode.GetTaskList: this.OnGetMsg_GetTaskList(operationResponse); goto IL_9E; case MobaGameCode.CompleteTask: goto IL_9E; case MobaGameCode.CompleteTaskMessage: this.OnGetMsg_CompleteTaskMessage(operationResponse); goto IL_9E; default: goto IL_9E; } break; case MobaGameCode.GetDailyTaskAward: this.OnGetMsg_GetReward(operationResponse); goto IL_9E; } goto IL_48; } IL_9E: base.TriggerListners(); }
public static void AddListener_preHandler(MobaGameCode code, MobaMessageFunc func) { if (func == null) { return; } if (!MVC_MessageManager.dicMabaGamePreHandler.ContainsKey(code)) { MVC_MessageManager.dicMabaGamePreHandler.Add(code, new List <MobaMessageFunc>()); } if (!MVC_MessageManager.dicMabaGamePreHandler[code].Contains(func)) { MVC_MessageManager.dicMabaGamePreHandler[code].Add(func); } }
protected override void OnGetMsg(MobaMessage msg) { MobaGameCode mobaGameCode = MVC_MessageManager.NotifyModel_to_Game((ClientMsg)msg.ID); MobaGameCode mobaGameCode2 = mobaGameCode; if (mobaGameCode2 != MobaGameCode.Login) { if (mobaGameCode2 == MobaGameCode.ClientReportOnlineTime) { this.OnCorrect(msg); } } else { this.OnLogin(msg); } base.TriggerListners(); }
protected override void OnGetMsg(MobaMessage msg) { if (msg != null) { OperationResponse operationResponse = msg.Param as OperationResponse; if (operationResponse != null) { MobaGameCode mobaGameCode = MVC_MessageManager.NotifyModel_to_Game((ClientMsg)msg.ID); base.LastMsgType = (int)mobaGameCode; MobaGameCode mobaGameCode2 = mobaGameCode; if (mobaGameCode2 == MobaGameCode.GetSignDay) { this.OnGetMsg_GetSignDay(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) { MobaGameCode mobaGameCode = MVC_MessageManager.NotifyModel_to_Game((ClientMsg)msg.ID); base.LastMsgType = (int)mobaGameCode; MobaGameCode mobaGameCode2 = mobaGameCode; if (mobaGameCode2 == MobaGameCode.GetMagicBottleRankList) { this.GetMagicBottleRankList(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) { 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 void OnGetMsgGameCode(MobaMessage msg) { base.DebugMessage = ((base.LastError != 0) ? "===>好友内容取失败" : "===>好友内容获取成功"); if (msg != null) { OperationResponse operationResponse = msg.Param as OperationResponse; if (operationResponse != null) { MobaGameCode mobaGameCode = MVC_MessageManager.NotifyModel_to_Game((ClientMsg)msg.ID); base.LastMsgType = msg.ID; MobaGameCode mobaGameCode2 = mobaGameCode; switch (mobaGameCode2) { case MobaGameCode.GetFriendMessages: this.OnGetMsg_GetFriendMessages(operationResponse); goto IL_9B; case MobaGameCode.SendPrivateMessage: IL_67: if (mobaGameCode2 != MobaGameCode.SystemNotice) { goto IL_9B; } this.OnGetMsg_SystemNotice(operationResponse); goto IL_9B; case MobaGameCode.GetUserInfoBySummId: this.OnGetMsg_GetUserInfoBySummId(operationResponse); goto IL_9B; } goto IL_67; } } IL_9B: base.Valid = ((base.LastError == 0 || base.LastError == 20109 || base.LastError == 20105 || base.LastError == 20106 || base.LastError == 20107 || base.LastError == 20104 || base.LastError == 20101) && null != base.Data); base.TriggerListners(); }
protected override void OnGetMsg(MobaMessage msg) { base.LastError = 505; OperationResponse operationResponse = msg.Param as OperationResponse; if (operationResponse != null) { MobaGameCode mobaGameCode = MVC_MessageManager.NotifyModel_to_Game((ClientMsg)msg.ID); MobaGameCode mobaGameCode2 = mobaGameCode; if (mobaGameCode2 != MobaGameCode.SweepBattle) { if (mobaGameCode2 != MobaGameCode.RestTodayBattlesCount) { if (mobaGameCode2 != MobaGameCode.UploadFightResult) { if (mobaGameCode2 == MobaGameCode.GetBattles) { this.OnGetMsg_GetBattles(operationResponse); } } else { this.OnGetMsg_UploadFightResult(operationResponse); } } else { this.OnGetMsg_RestTodayBattlesCount(operationResponse); } } else { this.OnGetMsg_SweepBattle(operationResponse); } } base.TriggerListners(); }
public static void UnRegistMessage(MobaGameCode msgID, MobaMessageFunc msgFunc) { MobaMessageManager.UnRegistMessage(MobaMessageType.GameCode, (int)msgID, msgFunc); }
public static MobaMessage GetMessage(MobaGameCode msgID, object msgParam, float delayTime = 0f) { return(new MobaMessage(MobaMessageType.GameCode, (int)msgID, msgParam, delayTime, null)); }
public static void AddListener_model(MobaGameCode code, MobaMessageFunc func) { MobaMessageManager.RegistMessage(MVC_MessageManager.Game_to_NotifyModel(code), func); }
public static void RemoveListener_view(MobaGameCode code, MobaMessageFunc func) { MobaMessageManager.UnRegistMessage(MVC_MessageManager.Game_to_NotifyView(code), func); }
public static ClientMsg Game_to_NotifyView(MobaGameCode code) { return(ClientMsg.NotifyView_game_begin + (int)code); }
protected override void OnGetMsg(MobaMessage msg) { UserData userData = ModelManager.Instance.Get_userData_X(); base.LastError = 505; OperationResponse operationResponse = msg.Param as OperationResponse; if (operationResponse != null) { MobaGameCode mobaGameCode = MVC_MessageManager.NotifyModel_to_Game((ClientMsg)msg.ID); MobaGameCode mobaGameCode2 = mobaGameCode; switch (mobaGameCode2) { case MobaGameCode.HeroAdvance: this.OnGetMsg_HeroAdvance(operationResponse); goto IL_1C2; case MobaGameCode.Enchant: this.OnGetMsg_Enchant(operationResponse); goto IL_1C2; case MobaGameCode.SellProps: this.OnGetMsg_SellProps(operationResponse); goto IL_1C2; case MobaGameCode.Coalesce: this.OnGetMsg_Coalesce(operationResponse); goto IL_1C2; case MobaGameCode.GetEquipmentList: this.OnGetMsg_GetEquipmentList(operationResponse); goto IL_1C2; case MobaGameCode.UsingEquipment: this.OnGetMsg_UsingEquipment(operationResponse); goto IL_1C2; case MobaGameCode.GetEquipmentDrop: case MobaGameCode.GetTalent: case MobaGameCode.ChangeTalent: case MobaGameCode.BuyTalentPag: case MobaGameCode.ModfiyTalentPag: case MobaGameCode.RestTalentPag: case MobaGameCode.GetRune: IL_86: switch (mobaGameCode2) { case MobaGameCode.SweepBattle: this.OnGetMsg_SweepBattle(operationResponse); goto IL_1C2; case MobaGameCode.RestTodayBattlesCount: case MobaGameCode.ReconnectToGameServer: case MobaGameCode.LuckyDrawState: IL_AB: if (mobaGameCode2 == MobaGameCode.BuyShopGoodsNew) { this.OnGetMsg_BuyShopGoodsNew(operationResponse); goto IL_1C2; } if (mobaGameCode2 == MobaGameCode.OneKeyCompose) { this.OnGetMsg_OneKeyCompose(operationResponse); goto IL_1C2; } if (mobaGameCode2 == MobaGameCode.ReceiveMailAttachment) { this.OnGetMsg_ReceiveMailAttachment(operationResponse); goto IL_1C2; } if (mobaGameCode2 == MobaGameCode.WearPrivateEffect) { this.OnGetMsg_WearPrivateEffect(operationResponse); goto IL_1C2; } if (mobaGameCode2 != MobaGameCode.ReceiveTBCReward) { goto IL_1C2; } this.OnGetMsg_ReceiveTBCReward(operationResponse); goto IL_1C2; case MobaGameCode.MagicBottleItem: this.OnGetMsg_UsingChangeNameCard(operationResponse); goto IL_1C2; case MobaGameCode.LuckyDraw: this.OnGetMsg_LuckyDraw(operationResponse); goto IL_1C2; case MobaGameCode.DischargeRune: this.OnGetMsg_DischargeRune(operationResponse); goto IL_1C2; } goto IL_AB; case MobaGameCode.UploadFightResult: this.OnGetMsg_UploadFightResult(operationResponse); goto IL_1C2; case MobaGameCode.UseSoulstone: this.OnGetMsg_UseSoulstone(operationResponse); goto IL_1C2; case MobaGameCode.UseProps: this.OnGetMsg_UseProps(operationResponse); goto IL_1C2; case MobaGameCode.ChangeRune: this.OnGetMsg_ChangeRune(operationResponse); goto IL_1C2; } goto IL_86; } IL_1C2: base.TriggerListners(); }