public MobaMessage(MobaMessageType type, int id, object param, float delayTime = 0f, object protoObj = null)
 {
     this.mParam            = param;
     this.mID               = id;
     this.mType             = type;
     this.mDelayElapsedTime = 0f;
     this.mDelayTime        = 0f;
     this._protoObj         = protoObj;
 }
Example #2
0
 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 OnTimeOut(MobaMessage msg)
 {
     if (msg != null)
     {
         MobaMessageType mobaMessageType = MobaMessageType.GameCode;
         int             num             = 204;
         MsgData_WaitServerResponsTimeout msgData_WaitServerResponsTimeout = (MsgData_WaitServerResponsTimeout)msg.Param;
         if (msgData_WaitServerResponsTimeout.MobaMsgType != mobaMessageType || msgData_WaitServerResponsTimeout.MsgID == num)
         {
         }
     }
 }
 private void OnTimeOut(MobaMessage msg)
 {
     if (msg != null)
     {
         MobaMessageType mobaMessageType = MobaMessageType.GameCode;
         int             num             = 161;
         MsgData_WaitServerResponsTimeout msgData_WaitServerResponsTimeout = (MsgData_WaitServerResponsTimeout)msg.Param;
         if (msgData_WaitServerResponsTimeout.MobaMsgType == mobaMessageType && msgData_WaitServerResponsTimeout.MsgID == num)
         {
             BottleViewCtrl.GetInstance().drawState = DrawState.Nothing;
         }
     }
 }
Example #5
0
 private void OnMsg_WaitServerResponseTimeOut(MobaMessage msg)
 {
     if (msg != null)
     {
         MobaMessageType mobaMessageType = MobaMessageType.GameCode;
         int             num             = 23049;
         MsgData_WaitServerResponsTimeout msgData_WaitServerResponsTimeout = (MsgData_WaitServerResponsTimeout)msg.Param;
         if (msgData_WaitServerResponsTimeout.MobaMsgType == mobaMessageType && msgData_WaitServerResponsTimeout.MsgID == num)
         {
             Singleton <TipView> .Instance.ShowViewSetText("获取数据失败!", 1f);
         }
     }
 }
 private void OnMsg_WaitServerResponseTimeOut(MobaMessage msg)
 {
     if (msg != null)
     {
         MobaMessageType mobaMessageType = MobaMessageType.ChatCode;
         int             num             = 2;
         MsgData_WaitServerResponsTimeout msgData_WaitServerResponsTimeout = (MsgData_WaitServerResponsTimeout)msg.Param;
         if (msgData_WaitServerResponsTimeout.MobaMsgType == mobaMessageType && msgData_WaitServerResponsTimeout.MsgID == num)
         {
             HomeChatCtrl.GetInstance().sendState = SendState.Nothing;
         }
     }
 }
 public static void UnRegistMessage(MobaMessageType msgType, int msgID, MobaMessageFunc msgFunc)
 {
     if (msgType < (MobaMessageType)MobaMessageManager.mMessageFuncList.Length)
     {
         Dictionary <int, MobaMessageFunc> dictionary = MobaMessageManager.mMessageFuncList[(int)msgType];
         if (dictionary != null && dictionary.ContainsKey(msgID))
         {
             Dictionary <int, MobaMessageFunc> dictionary2;
             Dictionary <int, MobaMessageFunc> expr_2A = dictionary2 = dictionary;
             MobaMessageFunc source = dictionary2[msgID];
             expr_2A[msgID] = (MobaMessageFunc)Delegate.Remove(source, msgFunc);
         }
     }
 }
 private void OnMsg_WaitServerResponseTimeOut(MobaMessage msg)
 {
     if (msg != null)
     {
         MobaMessageType mobaMessageType = MobaMessageType.GameCode;
         int             num             = 72;
         int             num2            = 204;
         MsgData_WaitServerResponsTimeout msgData_WaitServerResponsTimeout = (MsgData_WaitServerResponsTimeout)msg.Param;
         if (msgData_WaitServerResponsTimeout.MobaMsgType == mobaMessageType && (msgData_WaitServerResponsTimeout.MsgID == num || msgData_WaitServerResponsTimeout.MsgID == num2))
         {
             RunesCtrl.GetInstance().runestate = RunesInlayState.Nothing;
         }
     }
 }
Example #9
0
 public override void UnRegisterMsgHandler()
 {
     foreach (MobaMessageType current in this.Dic_Bottle.Keys)
     {
         List <int> list = this.Dic_Bottle[current];
         foreach (int current2 in list)
         {
             MobaMessageType mobaMessageType = current;
             if (mobaMessageType == MobaMessageType.GameCode)
             {
                 MVC_MessageManager.RemoveListener_model((MobaGameCode)current2, new MobaMessageFunc(this.OnGetMsg));
             }
         }
     }
 }
 private void OnMsg_WaitServerResponseTimeOut(MobaMessage msg)
 {
     if (msg != null)
     {
         MobaMessageType mobaMessageType = MobaMessageType.GameCode;
         int             num             = 230;
         MsgData_WaitServerResponsTimeout msgData_WaitServerResponsTimeout = (MsgData_WaitServerResponsTimeout)msg.Param;
         if (msgData_WaitServerResponsTimeout.MobaMsgType == mobaMessageType && msgData_WaitServerResponsTimeout.MsgID == num)
         {
             this.GenerateUnit();
             if (null != this.currEffectItem)
             {
                 MobaMessageManagerTools.SendClientMsg(ClientV2C.propviewClickCollectionItem, this.currEffectItem, false);
             }
             SacrificialCtrl.GetInstance().collectionState = CollectionState.Nothing;
         }
     }
 }
Example #11
0
 private void Add(string key, MobaMessageType type, int code, string text, bool normal, float waitTime, bool delayShow)
 {
     if (!this.dicWaitMsg.ContainsKey(key))
     {
         this.dicWaitMsg.Add(key, new WaitInfo(type, code, key, waitTime));
     }
     else
     {
         Dictionary <string, WaitInfo> dictionary;
         Dictionary <string, WaitInfo> expr_32 = dictionary = this.dicWaitMsg;
         WaitInfo w = dictionary[key];
         expr_32[key] = ++w;
     }
     this.curText   = text;
     this.delayShow = delayShow;
     this.normal    = normal;
     this.OpenWaitingView(true);
 }
Example #12
0
 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();
 }
Example #13
0
        protected override void OnGetMsg(MobaMessage msg)
        {
            int             num             = 0;
            MobaMessageType mobaMessageType = MVC_MessageManager.ClientMsg_to_RawCode((ClientMsg)msg.ID, out num);

            if (this.listCode.Contains((MobaGameCode)num))
            {
                string     name   = "OnGetMsg_" + mobaMessageType.ToString() + "_" + ((MobaGameCode)num).ToString();
                MethodInfo method = base.GetType().GetMethod(name, BindingFlags.Instance | BindingFlags.NonPublic);
                if (method != null)
                {
                    object[] parameters = new object[]
                    {
                        msg
                    };
                    method.Invoke(this, parameters);
                    base.TriggerListners();
                }
            }
        }
Example #14
0
        private string FormatMsg(MobaMessageType type, int code)
        {
            switch (type)
            {
            case MobaMessageType.MasterCode:
                return(type + "_" + (MobaMasterCode)code);

            case MobaMessageType.GameCode:
                return(type + "_" + (MobaGameCode)code);

            case MobaMessageType.PvpCode:
                return(type + "_" + (PvpCode)code);

            default:
                if (type != MobaMessageType.Client)
                {
                    return(type + "_" + code);
                }
                return(type + "_" + (ClientMsg)code);
            }
        }
 public static void RegistMessage(MobaMessageType type, int msgID, MobaMessageFunc msgFunc)
 {
     if (type < (MobaMessageType)MobaMessageManager.mMessageFuncList.Length)
     {
         if (MobaMessageManager.mMessageFuncList[(int)type] == null)
         {
             MobaMessageManager.mMessageFuncList[(int)type] = new Dictionary <int, MobaMessageFunc>();
         }
         Dictionary <int, MobaMessageFunc> dictionary = MobaMessageManager.mMessageFuncList[(int)type];
         if (dictionary.ContainsKey(msgID))
         {
             Dictionary <int, MobaMessageFunc> dictionary2;
             Dictionary <int, MobaMessageFunc> expr_3C = dictionary2 = dictionary;
             MobaMessageFunc a = dictionary2[msgID];
             expr_3C[msgID] = (MobaMessageFunc)Delegate.Combine(a, msgFunc);
         }
         else
         {
             dictionary[msgID] = msgFunc;
         }
     }
 }
Example #16
0
        protected override void OnGetMsg(MobaMessage msg)
        {
            int             num             = 0;
            MobaMessageType mobaMessageType = MVC_MessageManager.ClientMsg_to_RawCode((ClientMsg)msg.ID, out num);

            if (this.Dic_Bottle.ContainsKey(mobaMessageType) && this.Dic_Bottle[mobaMessageType].Contains(num))
            {
                string          text             = "OnGetMsg_" + mobaMessageType.ToString() + "_";
                MobaMessageType mobaMessageType2 = mobaMessageType;
                if (mobaMessageType2 == MobaMessageType.GameCode)
                {
                    text += ((MobaGameCode)num).ToString();
                }
                MethodInfo method = base.GetType().GetMethod(text, BindingFlags.Instance | BindingFlags.NonPublic);
                if (method != null)
                {
                    object[] parameters = new object[]
                    {
                        msg
                    };
                    method.Invoke(this, parameters);
                }
            }
        }
Example #17
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);
        }
 public MsgData_WaitServerResponsTimeout(MobaMessageType type, int msgID)
 {
     this._type  = type;
     this._msgID = msgID;
 }
Example #19
0
        public void Waiting(MobaMessageType type, int code, string text = "waiting server...", bool normal = true, float time = 15f, bool delayShow = true)
        {
            string key = this.FormatMsg(type, code);

            this.Add(key, type, code, text, normal, time, delayShow);
        }