コード例 #1
0
        public static MobaMessageType ClientMsg_to_RawCode(ClientMsg code, out int retCode)
        {
            MobaMessageType result = MobaMessageType.Client;

            retCode = 0;
            if (code >= ClientMsg.NotifyModel_master_begin && code < ClientMsg.NotifyModel_master_end)
            {
                retCode = (int)MVC_MessageManager.NotifyModel_to_Master(code);
                result  = MobaMessageType.MasterCode;
            }
            else if (code >= ClientMsg.NotifyModel_game_begin && code < ClientMsg.NotifyModel_game_end)
            {
                retCode = (int)MVC_MessageManager.NotifyModel_to_Game(code);
                result  = MobaMessageType.GameCode;
            }
            else if (code >= ClientMsg.NotifyModel_friend_begin && code < ClientMsg.NotifyModel_friend_end)
            {
                retCode = (int)MVC_MessageManager.NotifyModel_to_Friend(code);
                result  = MobaMessageType.FriendCode;
            }
            else if (code >= ClientMsg.NotifyModel_chat_begin && code < ClientMsg.NotifyModel_chat_end)
            {
                retCode = (int)MVC_MessageManager.NotifyModel_to_Chat(code);
                result  = MobaMessageType.ChatCode;
            }
            else if (code >= ClientMsg.NotifyModel_teamroom_begin && code < ClientMsg.NotifyModel_teamroom_end)
            {
                retCode = (int)MVC_MessageManager.NotifyModel_to_TeamRoom(code);
                result  = MobaMessageType.FriendCode;
            }
            else if (code >= ClientMsg.NotifyModel_userdata_begin && code < ClientMsg.NotifyModel_userdata_end)
            {
                retCode = (int)MVC_MessageManager.NotifyModel_to_UserData(code);
                result  = MobaMessageType.UserDataCode;
            }
            else if (code >= ClientMsg.NotifyView_master_begin && code < ClientMsg.NotifyView_game_begin)
            {
                retCode = (int)MVC_MessageManager.NotifyView_to_Master(code);
                result  = MobaMessageType.MasterCode;
            }
            else if (code >= ClientMsg.NotifyView_game_begin && code < ClientMsg.NotifyView_game_end)
            {
                retCode = (int)MVC_MessageManager.NotifyView_to_Game(code);
                result  = MobaMessageType.GameCode;
            }
            else if (code >= ClientMsg.NotifyView_friend_begin && code < ClientMsg.NotifyView_friend_end)
            {
                retCode = (int)MVC_MessageManager.NotifyView_to_Friend(code);
                result  = MobaMessageType.FriendCode;
            }
            else if (code >= ClientMsg.NotifyView_chat_begin && code < ClientMsg.NotifyView_chat_end)
            {
                retCode = (int)MVC_MessageManager.NotifyView_to_Chat(code);
                result  = MobaMessageType.ChatCode;
            }
            else if (code >= ClientMsg.NotifyView_teamroom_begin && code < ClientMsg.NotifyView_teamroom_end)
            {
                retCode = (int)MVC_MessageManager.NotifyView_to_TeamRoom(code);
                result  = MobaMessageType.FriendCode;
            }
            else if (code >= ClientMsg.NotifyView_userdata_begin && code < ClientMsg.NotifyView_userdata_end)
            {
                retCode = (int)MVC_MessageManager.NotifyView_to_UserData(code);
                result  = MobaMessageType.UserDataCode;
            }
            return(result);
        }