コード例 #1
0
        private static void OnGetMsg(MobaMessage msg)
        {
            if (msg == null)
            {
                return;
            }
            ClientMsg msgID  = ClientMsg.PeerConnectTimeOut;
            ClientMsg msgID2 = ClientMsg.PeerConnectTimeOut;

            switch (msg.MessageType)
            {
            case MobaMessageType.MasterCode:
                MVC_MessageManager.PreHandler((MobaMasterCode)msg.ID, msg);
                msgID  = MVC_MessageManager.Master_to_NotifyModel((MobaMasterCode)msg.ID);
                msgID2 = MVC_MessageManager.Master_to_NotifyView((MobaMasterCode)msg.ID);
                break;

            case MobaMessageType.GameCode:
                if (MenuView.dicTimes.ContainsKey((MobaGameCode)msg.ID))
                {
                }
                MVC_MessageManager.PreHandler((MobaGameCode)msg.ID, msg);
                msgID  = MVC_MessageManager.Game_to_NotifyModel((MobaGameCode)msg.ID);
                msgID2 = MVC_MessageManager.Game_to_NotifyView((MobaGameCode)msg.ID);
                break;

            case MobaMessageType.ChatCode:
                MVC_MessageManager.PreHandler((MobaChatCode)msg.ID, msg);
                msgID  = MVC_MessageManager.Chat_to_NotifyModel((MobaChatCode)msg.ID);
                msgID2 = MVC_MessageManager.Chat_to_NotifyView((MobaChatCode)msg.ID);
                break;

            case MobaMessageType.FriendCode:
                MVC_MessageManager.PreHandler((MobaFriendCode)msg.ID, msg);
                msgID  = MVC_MessageManager.Friend_to_NotifyModel((MobaFriendCode)msg.ID);
                msgID2 = MVC_MessageManager.Friend_to_NotifyView((MobaFriendCode)msg.ID);
                break;

            case MobaMessageType.TeamRoomCode:
                MVC_MessageManager.PreHandler((MobaTeamRoomCode)msg.ID, msg);
                msgID  = MVC_MessageManager.TeamRoom_to_NotifyModel((MobaTeamRoomCode)msg.ID);
                msgID2 = MVC_MessageManager.TeamRoom_to_NotifyView((MobaTeamRoomCode)msg.ID);
                break;

            case MobaMessageType.UserDataCode:
                MVC_MessageManager.PreHandler((MobaUserDataCode)msg.ID, msg);
                msgID  = MVC_MessageManager.UserData_to_NotifyModel((MobaUserDataCode)msg.ID);
                msgID2 = MVC_MessageManager.UserData_to_NotifyView((MobaUserDataCode)msg.ID);
                break;

            case MobaMessageType.GateCode:
                MVC_MessageManager.PreHandler((MobaGameCode)msg.ID, msg);
                msgID2 = MVC_MessageManager.Gate_to_NotifyView((MobaGateCode)msg.ID);
                break;
            }
            MobaMessage message = MobaMessageManager.GetMessage(msgID, msg.Param, 0f);

            MobaMessageManager.ExecuteMsg(message);
            MobaMessage message2 = MobaMessageManager.GetMessage(msgID2, msg.Param, 0f);

            MobaMessageManager.ExecuteMsg(message2);
        }