コード例 #1
0
        protected void TriggerListners()
        {
            CommonModelNotifyParam notifyData = this.GetNotifyData();
            MobaMessage            message    = MobaMessageManager.GetMessage((ClientMsg)this.modelType, notifyData, 0f);

            MobaMessageManager.ExecuteMsg(message);
        }
コード例 #2
0
        protected override void OnGetMsg(MobaMessage msg)
        {
            base.DebugMessage = ((base.LastError != 0) ? "===>邮件列表获取失败" : "===>邮件列表获取成功");
            if (msg != null)
            {
                OperationResponse operationResponse = msg.Param as OperationResponse;
                if (operationResponse != null)
                {
                    switch (MVC_MessageManager.NotifyModel_to_Game((ClientMsg)msg.ID))
                    {
                    case MobaGameCode.ReceiveMailAttachment:
                        this.OnGetMsg_ReceiveMailAttachment(operationResponse);
                        base.LastMsgType = 80;
                        break;

                    case MobaGameCode.GetMailList:
                        this.OnGetMsg_MailList(operationResponse);
                        base.LastMsgType = 81;
                        break;

                    case MobaGameCode.ModifyEmailState:
                        this.OnGetMsg_ModifyEmailState(operationResponse);
                        base.LastMsgType = 83;
                        break;
                    }
                }
            }
            base.Valid = (base.LastError == 0 && null != base.Data);
            base.TriggerListners();
        }
コード例 #3
0
 private void ActionLevelUp(MobaMessage msg)
 {
     if (msg != null)
     {
         int num = (int)msg.Param;
         if (num != 0)
         {
             if (Tools_ParsePrice.IsCollectorBottleUp(this.currlevel, num))
             {
                 this.CountCollect++;
                 this.collectGetFX.gameObject.SetActive(false);
                 this.collectGetFX.gameObject.SetActive(true);
                 AudioMgr.Play("Play_DCP_Levelup", null, false, false);
             }
             this.currlevel = num;
             if (this.currlevel % 3 == 0)
             {
                 this.CountLegend++;
                 this.legendGetFX.gameObject.SetActive(false);
                 this.legendGetFX.gameObject.SetActive(true);
                 AudioMgr.Play("Play_CSP_Levelup", null, false, false);
             }
             this.RefreshDesUI();
         }
     }
 }
コード例 #4
0
ファイル: PropertyView.cs プロジェクト: whztt07/mobahero_src
 private void OnClickArrow(MobaMessage msg)
 {
     if (msg.Param != null)
     {
         bool flag = (bool)msg.Param;
         if (this.RecordPropertyHeroName.Length > 1)
         {
             int      num = 0;
             string[] recordPropertyHeroName = this.RecordPropertyHeroName;
             for (int i = 0; i < recordPropertyHeroName.Length; i++)
             {
                 if (recordPropertyHeroName[i] == this.heroNPC)
                 {
                     num = i;
                     break;
                 }
             }
             if (flag)
             {
                 this.heroNPC = recordPropertyHeroName[(num + 1) % recordPropertyHeroName.Length];
             }
             else
             {
                 this.heroNPC = recordPropertyHeroName[((num - 1 >= 0) ? (num - 1) : (num - 1 + recordPropertyHeroName.Length)) % recordPropertyHeroName.Length];
             }
             MobaMessageManagerTools.SendClientMsg(ClientV2C.sacriviewChangeHero, this.heroNPC, false);
         }
     }
 }
コード例 #5
0
 private void OnMsg_LoadView_complete(MobaMessage msg)
 {
     MobaMessageManager.UnRegistMessage(ClientV2C.LoadView2_subComplete, new MobaMessageFunc(this.OnMsg_LoadView_complete));
     CtrlManager.CloseWindow(WindowID.LoadView2);
     PlayerMng.Instance.Enable(false);
     base.SetGoOn();
 }
コード例 #6
0
        private void OnMsg_Chat_ListenPrivate(MobaMessage msg)
        {
            if (msg != null)
            {
                OperationResponse operationResponse = msg.Param as OperationResponse;
                if (operationResponse != null)
                {
                    string text = (string)operationResponse.Parameters[102];
                    if (text != null && text.Length > 0)
                    {
                        if (Singleton <FriendView> .Instance.newMessageList.Contains(ToolsFacade.Instance.GetUserIdBySummId(long.Parse(text))))
                        {
                            Singleton <FriendView> .Instance.newMessageList.Remove(ToolsFacade.Instance.GetUserIdBySummId(long.Parse(text)));

                            Singleton <HomeChatview> .Instance.UpdateNewsPoint();

                            this.HideMessageSign(text);
                        }
                        Dictionary <byte, object> dictionary = new Dictionary <byte, object>();
                        dictionary.Add(102, text);
                        NetWorkHelper.Instance.client.SendSessionChannelMessage(4, MobaChannel.Chat, dictionary);
                    }
                }
            }
        }
コード例 #7
0
 private void OnMsg_chatviewInitRoom(MobaMessage msg)
 {
     if (msg.Param != null)
     {
         if ((int)msg.Param == 3)
         {
             Queue <ChatMessageNew> queue = ModelManager.Instance.Get_Lobby_Chat_DataX();
             if (!Singleton <HomeChatview> .Instance.hasClearRoomChat)
             {
                 this.ClearGrid(out Singleton <HomeChatview> .Instance.hasClearRoomChat);
             }
             while (queue.Count > 0)
             {
                 ChatMessageNew chatMessageNew = queue.Dequeue();
                 bool           isSelf         = chatMessageNew.Client.UserId == Singleton <HomeChatview> .Instance.UserID;
                 this.DisplayData(chatMessageNew, isSelf);
             }
             this.mRoomChatRoot.SetActive(true);
             this.mScrollView.ResetPosition();
             this.JudgePosition();
         }
         else
         {
             this.mRoomChatRoot.SetActive(false);
         }
     }
 }
コード例 #8
0
    private void OnGetMsg_CompleteTaskMessage(MobaMessage msg)
    {
        OperationResponse operationResponse = msg.Param as OperationResponse;

        if (operationResponse == null)
        {
            return;
        }
        int           num           = (int)operationResponse.Parameters[1];
        MobaErrorCode mobaErrorCode = (MobaErrorCode)num;

        if (mobaErrorCode == MobaErrorCode.Ok)
        {
            int num2 = (int)operationResponse.Parameters[123];
            int num3 = (int)operationResponse.Parameters[252];
            int num4 = (int)operationResponse.Parameters[241];
            this.OnCompleteTaskMessage(num4, num2, num3);
            if (num4 == 1)
            {
                SendMsgManager.Instance.SendMsg(MobaGameCode.GetTaskList, null, new object[]
                {
                    num3
                });
            }
            else if (num4 == 3 && (num2 == 10101 || num2 == 10102))
            {
                Singleton <MenuView> .Instance.UpdateFirstPay();
            }
        }
    }
コード例 #9
0
    private void OnGetMailList(MobaMessage msg)
    {
        if (msg == null)
        {
            return;
        }
        OperationResponse operationResponse = msg.Param as OperationResponse;

        if (operationResponse == null)
        {
            return;
        }
        int           num           = (int)operationResponse.Parameters[1];
        MobaErrorCode mobaErrorCode = (MobaErrorCode)num;

        if (mobaErrorCode == MobaErrorCode.Ok)
        {
            Singleton <MenuBottomBarView> .Instance.CheckEmailNewsState();

            if (null != Singleton <MailView> .Instance.gameObject && Singleton <MailView> .Instance.gameObject.activeInHierarchy)
            {
                Singleton <MailView> .Instance.UpdateMailView();
            }
        }
    }
コード例 #10
0
 private void OnMsg_coalesceviewAdjustMiddle(MobaMessage msg)
 {
     if (msg.Param == null)
     {
         this.ResetSectionState();
     }
 }
コード例 #11
0
    private void OnGetMsg_OnChangeGroupst(MobaMessage msg)
    {
        if (msg == null)
        {
            return;
        }
        OperationResponse operationResponse = msg.Param as OperationResponse;

        if (operationResponse == null)
        {
            return;
        }
        int           num           = (int)operationResponse.Parameters[1];
        MobaErrorCode mobaErrorCode = (MobaErrorCode)num;

        if (mobaErrorCode != MobaErrorCode.Ok)
        {
            this.OnNotificationEvent(num, operationResponse.DebugMessage, null);
        }
        else
        {
            byte[]           buffer           = operationResponse.Parameters[40] as byte[];
            NotificationData notificationData = SerializeHelper.Deserialize <NotificationData>(buffer);
            this.OnNotificationEvent(num, operationResponse.DebugMessage, notificationData);
        }
    }
コード例 #12
0
        private void P2C_QueryInFightInfo(MobaMessage msg)
        {
            InBattleRuntimeInfo probufMsg = msg.GetProbufMsg <InBattleRuntimeInfo>();

            PvpStateBase.LogState("receive P2C_QueryInFightInfo " + StringUtils.DumpObject(probufMsg));
            if (probufMsg == null)
            {
                PvpStateBase.LogState("no fight info");
            }
            else
            {
                GameManager.Instance.ReplayController.SaveReconnectSyncMsgForRecord(msg.Param);
                PvpProtocolTools.SyncFightInfo(probufMsg);
                if (probufMsg.roomState == 3)
                {
                    Singleton <PvpManager> .Instance.AbandonGame(PvpErrorCode.StateError);
                }
            }
            if (this.TargetState == PlayerState.InFight || probufMsg != null)
            {
                this.RecoverFinish(new PvpStateStart(PvpStateCode.PvpStart));
            }
            else
            {
                SendMsgManager.Instance.SendPvpMsg(PvpCode.C2P_LoadingOK, null);
                this.RecoverFinish(new PvpStateLoad());
            }
        }
コード例 #13
0
        private void P2C_BackLoadingInfo(MobaMessage msg)
        {
            InLoadingRuntimeInfo probufMsg = msg.GetProbufMsg <InLoadingRuntimeInfo>();

            PvpStateBase.LogState("receive P2C_BackLoadingInfo  " + StringUtils.DumpObject(probufMsg));
            Singleton <PvpManager> .Instance.RoomInfo.UpdateAllLoadProgress(probufMsg.loadProcessDic);
        }
コード例 #14
0
        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);
                }
            }
        }
コード例 #15
0
        private void OnMsg_Chat_GetGlobleMsg(MobaMessage msg)
        {
            OperationResponse operationResponse = msg.Param as OperationResponse;

            byte[] buffer = (byte[])operationResponse.Parameters[100];
            ChatMessagePullData chatMessagePullData = SerializeHelper.Deserialize <ChatMessagePullData>(buffer);

            if (chatMessagePullData != null && chatMessagePullData.messages != null)
            {
                foreach (ChatMessageNew current in chatMessagePullData.messages)
                {
                    UserData userData = ModelManager.Instance.Get_userData_X();
                    if (Model_HomeChat.LastMsgId == current.MessageId)
                    {
                        break;
                    }
                    MobaMessageManagerTools.SendClientMsg(ClientC2V.ReceiveHallChatMessage, current, false);
                    Model_HomeChat.LastMsgId = current.MessageId;
                    Debug.Log(string.Concat(new object[]
                    {
                        "OnMsgChat_GetGlobleMsg mes:",
                        current.Message,
                        "   id:",
                        current.MessageId
                    }));
                }
            }
        }
コード例 #16
0
    private void OnGetChargeInfo(MobaMessage msg)
    {
        if (msg == null)
        {
            return;
        }
        OperationResponse operationResponse = msg.Param as OperationResponse;

        if (operationResponse == null)
        {
            return;
        }
        int           num           = (int)operationResponse.Parameters[1];
        MobaErrorCode mobaErrorCode = (MobaErrorCode)num;

        if (mobaErrorCode == MobaErrorCode.Ok)
        {
            PayDimondData payDimondData       = SerializeHelper.Deserialize <PayDimondData>(operationResponse.Parameters[84] as byte[]);
            SendMsgManager.SendMsgParam param = new SendMsgManager.SendMsgParam(false, "刷新数据...", true, 15f);
            int num2 = 2;
            SendMsgManager.Instance.SendMsg(MobaGameCode.GetCurrencyCount, param, new object[]
            {
                num2
            });
        }
    }
コード例 #17
0
        private void OnMsg_CheckResourceOver(MobaMessage msg)
        {
            object[]        array           = msg.Param as object[];
            string          content         = string.Empty;
            EAssetLoadError eAssetLoadError = EAssetLoadError.eUnknowReason;

            if (array != null && array.Length == 3)
            {
                eAssetLoadError = (EAssetLoadError)((int)array[0]);
            }
            switch (eAssetLoadError)
            {
            case EAssetLoadError.eWWWError:
                content = "资源下载失败,www错误,是否重试?";
                this.ShowMsgBox("资源下载", content, new Action(this.CheckAsset), new Action(this.Del_quit), "重试", "取消");
                break;

            case EAssetLoadError.eInsufficientSpace:
                this.HandleParams(array[1]);
                content = "磁盘空间不足,是否重试?" + this.GetSpaceNotice();
                this.ShowMsgBox("资源下载", content, new Action(this.CheckAsset), new Action(this.Del_quit), "重试", "取消");
                break;

            case EAssetLoadError.eCheckDownLoadOK:
                this.HandleParams(array[1]);
                content = "请确认下载资源" + this.GetSpaceNotice();
                this.CheckWIFI();
                break;

            case EAssetLoadError.eNoNeedToDownloadAsset:
                this.HandleParams(array[1]);
                this.CheckFinish();
                break;
            }
        }
コード例 #18
0
        public void ResetPage()
        {
            this.ButtonLabel.text = LanguageManager.Instance.GetStringById("LiveorPlayback_Playback003", "Edit");
            MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)26030, false, 0f);

            MobaMessageManager.ExecuteMsg(message);
        }
コード例 #19
0
        private void OnMsg_Friend_GetFriendList(MobaMessage msg)
        {
            if (msg == null)
            {
                return;
            }
            OperationResponse operationResponse = msg.Param as OperationResponse;

            if (operationResponse == null)
            {
                return;
            }
            int           num           = (int)operationResponse.Parameters[1];
            MobaErrorCode mobaErrorCode = (MobaErrorCode)num;

            if (mobaErrorCode == MobaErrorCode.Ok)
            {
                byte[]            buffer   = operationResponse.Parameters[27] as byte[];
                List <FriendData> dataList = SerializeHelper.Deserialize <List <FriendData> >(buffer);
                if (this.listTask != null)
                {
                    this.listTask.Stop();
                }
                this.listTask = this.coroutineManager.StartCoroutine(this.StartGetFriendList(dataList), true);
            }
        }
コード例 #20
0
 private void OnMsg_GateDisconnected(MobaMessage msg)
 {
     if (this.coroutine != null)
     {
         this.coroutine.StopAllCoroutine();
     }
 }
コード例 #21
0
 private void OnMsg_chatviewSendMessage(MobaMessage msg)
 {
     if (msg.Param != null)
     {
         this.SendChat();
     }
 }
コード例 #22
0
        private void OnLogin(MobaMessage msg)
        {
            LoginTime         loginTime         = base.Data as LoginTime;
            OperationResponse operationResponse = msg.Param as OperationResponse;

            if (operationResponse != null)
            {
                base.LastError = (int)operationResponse.Parameters[1];
                if (base.LastError == 0)
                {
                    loginTime.IsCorrected = false;
                    byte[]   buffer   = operationResponse.Parameters[86] as byte[];
                    UserData userData = SerializeHelper.Deserialize <UserData>(buffer);
                    if (operationResponse.Parameters.ContainsKey(230))
                    {
                        List <string> freeHeros = SerializeHelper.Deserialize <List <string> >(operationResponse.Parameters[230] as byte[]);
                        Singleton <PvpManager> .Instance.freeHeros = freeHeros;
                    }
                    if (userData != null)
                    {
                        loginTime.loginTime_Local = DateTime.Now;
                        DateTime dateTime = DateTime.Parse(userData.ServerTime);
                        loginTime.loginTime_Server = dateTime;
                        loginTime.TimeSpan_login   = dateTime - DateTime.Now;
                        base.Valid = true;
                    }
                }
            }
        }
コード例 #23
0
 private void BattleEnd(MobaMessage msg)
 {
     this.LmGrassInfo.Clear();
     this.BlGrassInfo.Clear();
     MobaMessageManager.UnRegistMessage((ClientMsg)25039, new MobaMessageFunc(this.BattleEnd));
     Units.OnUnitsDead += new Action <Units, Units>(this.OnUnitsDead);
 }
コード例 #24
0
 private void OnMsg_chatviewSendMessage(MobaMessage msg)
 {
     if (msg != null)
     {
         this.SendChat(base.gameObject);
     }
 }
コード例 #25
0
        private void OnGetMsg_ModfiyNickName(MobaMessage msg)
        {
            if (msg == null)
            {
                return;
            }
            OperationResponse operationResponse = msg.Param as OperationResponse;

            if (operationResponse == null)
            {
                return;
            }
            int           num           = (int)operationResponse.Parameters[1];
            MobaErrorCode mobaErrorCode = (MobaErrorCode)num;

            if (mobaErrorCode != MobaErrorCode.Ok)
            {
                if (mobaErrorCode != MobaErrorCode.NickNameExist)
                {
                    this.ClickChangeName(num, operationResponse.DebugMessage, string.Empty);
                }
                else
                {
                    this.ClickChangeName(num, operationResponse.DebugMessage, string.Empty);
                }
            }
            else
            {
                string k = (string)operationResponse.Parameters[232];
                this.ClickChangeName(num, operationResponse.DebugMessage, k);
            }
        }
コード例 #26
0
        private void OnMsg_ApplicationPause(MobaMessage msg)
        {
            bool flag = (bool)msg.Param;

            this.playStateFlag = !flag;
            this.ApplyPlayPauseState();
        }
コード例 #27
0
        private void OnGetMsg_RoomsManager(MobaMessage msg)
        {
            if (Singleton <PvpRoomView> .Instance.gameObject != null && Singleton <PvpRoomView> .Instance.gameObject.activeSelf)
            {
                return;
            }
            OperationResponse operationResponse = msg.Param as OperationResponse;

            if (operationResponse == null)
            {
                return;
            }
            int           num           = (int)operationResponse.Parameters[1];
            MobaErrorCode mobaErrorCode = (MobaErrorCode)num;

            if (mobaErrorCode != MobaErrorCode.Ok)
            {
                if (mobaErrorCode != MobaErrorCode.TableNotExist)
                {
                    Singleton <TipView> .Instance.ShowViewSetText(LanguageManager.Instance.GetStringById("GangUpUI_Tips_JoinTheRoom"), 1f);
                }
                else
                {
                    Singleton <TipView> .Instance.ShowViewSetText("房间已经不存在", 1f);
                }
            }
        }
コード例 #28
0
ファイル: PlayerMng.cs プロジェクト: whztt07/mobahero_src
    private void callback_Ready(IVedioController player)
    {
        MsgData_VedioCallback msgParam = new MsgData_VedioCallback(player.ID, player.Resource);
        MobaMessage           message  = MobaMessageManager.GetMessage((ClientMsg)25014, msgParam, 0f);

        MobaMessageManager.ExecuteMsg(message);
    }
コード例 #29
0
 private void OnMsg_coalesceviewAfterPurchase(MobaMessage msg)
 {
     if (msg != null)
     {
         this.ReFreshLack();
     }
 }
コード例 #30
0
ファイル: Model_logId.cs プロジェクト: whztt07/mobahero_src
        private void OnGetMsg_GameCode_UploadArenaAtc(MobaMessage msg)
        {
            base.LastError = 505;
            OperationResponse operationResponse;

            if (this.PreHandel(msg, out operationResponse))
            {
                base.LastError = (int)operationResponse.Parameters[1];
                MobaErrorCode lastError = (MobaErrorCode)base.LastError;
                if (lastError != MobaErrorCode.Ok)
                {
                    if (lastError != MobaErrorCode.MoneyShortage)
                    {
                        base.DebugMessage = "===>TryUsingSkillPointResponse" + operationResponse.OperationCode;
                    }
                    else
                    {
                        base.DebugMessage = "===>TryUsingSkillPointResponse->金币不足!";
                    }
                }
                else
                {
                    long num = (long)operationResponse.Parameters[181];
                    base.Data         = num;
                    base.DebugMessage = "===>OnGetMsg_GameCode_UploadArenaAtc ...LogId" + operationResponse.OperationCode;
                }
            }
            base.Valid = (base.LastError == 0 && null != base.Data);
        }