public static void SetSkillPanelPivot(SkillPanelPivot _param)
    {
        MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)26020, _param, 0f);

        MobaMessageManager.ExecuteMsg(message);
        Singleton <HUDModuleManager> .Instance.SetSkillPanelPivot(_param);
    }
Exemplo n.º 2
0
    protected override void DispatchDeadEvent(Units attacker)
    {
        if (base.MirrorState)
        {
            return;
        }
        if (this.isHero && attacker != null && (attacker.isHero || attacker.isPlayer))
        {
            Singleton <TriggerManager> .Instance.SendUnitStateEvent(UnitEvent.UnitKillAndAssist, attacker, null, null);
        }
        MobaMessageManager.DispatchMsg(MobaMessageManager.GetMessage((ClientMsg)25056, new ParamUnitDead(attacker, this), 0f));
        Singleton <TriggerManager> .Instance.SendGameStateEvent(GameEvent.UntiDead);

        Singleton <TriggerManager> .Instance.SendUnitStateEvent(UnitEvent.UnitKillTarget, attacker, this, null);

        Singleton <TriggerManager> .Instance.SendUnitStateEvent(UnitEvent.UnitDeath, this, attacker, null);

        if (this.isHero)
        {
            if (base.teamType == 0)
            {
                Singleton <TriggerManager> .Instance.SendGameStateEvent(GameEvent.LMHeroDead);
            }
            else if (base.teamType == 1)
            {
                Singleton <TriggerManager> .Instance.SendGameStateEvent(GameEvent.BLHeroDead);
            }
        }
        base.DispatchDeadEvent(attacker);
    }
    public void ReceiveFrame(long frameCnt)
    {
        this.newNetFrameNum = frameCnt;
        MobaMessage message = MobaMessageManager.GetMessage(PvpCode.P2C_FrameSync, frameCnt, 0f, null);

        this.ReceiveMsg(message);
    }
        private void OnGetMsg_GameCode_GetMagicBottleInfo(MobaMessage msg)
        {
            base.LastError = 505;
            OperationResponse operationResponse;

            if (this.PreHandel(msg, out operationResponse))
            {
                base.LastError = (int)operationResponse.Parameters[1];
                if (base.LastError == 0)
                {
                    MagicBottleData magicBottleData  = SerializeHelper.Deserialize <MagicBottleData>(operationResponse.Parameters[236] as byte[]);
                    MagicBottleData magicBottleData2 = base.Data as MagicBottleData;
                    if (magicBottleData != null)
                    {
                        magicBottleData2 = magicBottleData;
                        base.Data        = magicBottleData2;
                        Dictionary <string, SysMagicbottleExpVo> typeDicByType = BaseDataMgr.instance.GetTypeDicByType <SysMagicbottleExpVo>();
                        uint num = this.Level_Check(uint.Parse(magicBottleData2.curlevel.ToString()), typeDicByType);
                        if (!typeDicByType.ContainsKey(num.ToString()))
                        {
                            Debug.LogError("小魔瓶的等级范围在字典中不存在,DK找策划看看。");
                        }
                        else
                        {
                            Model_BottleSystem.Exp_Max   = typeDicByType[num.ToString()].exp;
                            Model_BottleSystem.extraCost = typeDicByType[num.ToString()].ExtraCost;
                        }
                    }
                    MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)23054, magicBottleData2, 0f);
                    MobaMessageManager.ExecuteMsg(message);
                }
            }
            base.TriggerListners();
        }
Exemplo n.º 5
0
        protected void TriggerListners()
        {
            CommonModelNotifyParam notifyData = this.GetNotifyData();
            MobaMessage            message    = MobaMessageManager.GetMessage((ClientMsg)this.modelType, notifyData, 0f);

            MobaMessageManager.ExecuteMsg(message);
        }
        public void ResetPage()
        {
            this.ButtonLabel.text = LanguageManager.Instance.GetStringById("LiveorPlayback_Playback003", "Edit");
            MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)26030, false, 0f);

            MobaMessageManager.ExecuteMsg(message);
        }
        public static void DoPveBuy(ShopInfo shopInfo, Units unit, string targetItemID, List <ItemInfo> possessItemsP, int realPrice)
        {
            List <ItemInfo> list        = new List <ItemInfo>(possessItemsP);
            List <string>   composition = BattleEquipTools_Travers.GetComposition(targetItemID, list);

            if (composition != null || composition.Count > 0)
            {
                for (int i = 0; i < composition.Count; i++)
                {
                    ItemInfo target;
                    int      index;
                    if (BattleEquipTools_Travers.GetItem_last_least(list, composition[i], out target, out index))
                    {
                        BattleEquipTools_op.RemoveItem(list, target, index);
                    }
                }
            }
            BattleEquipTools_op.AddItem(list, targetItemID);
            BattleEquipTools_op.ChangeHeroMoney(unit.unique_id, -realPrice);
            BattleEquipTools_op.SetHeroItems(unit, list);
            byte[] msgParam = SerializeHelper.Serialize <P2CBuyItem>(new P2CBuyItem
            {
                itemoid  = 0,
                retaCode = 0
            });
            MobaMessage message = MobaMessageManager.GetMessage(PvpCode.C2P_BuyItem, msgParam, 0f, null);

            MobaMessageManager.DispatchMsg(message);
        }
Exemplo n.º 8
0
    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);
    }
Exemplo n.º 9
0
        private void LoginServer(string editusername, string editpassworld, byte LoginType)
        {
            AccountData accountData = new AccountData
            {
                Mail      = editusername,
                UserName  = editusername,
                Password  = editpassworld,
                ChannelId = "1"
            };

            ModelManager.Instance.Set_accountData_X(accountData);
            if (this.toggle.value)
            {
                PlayerPrefs.SetString("SavePassWord", "true");
            }
            else
            {
                PlayerPrefs.SetString("SavePassWord", "false");
            }
            if (LoginType == 1)
            {
                MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)21006, accountData, 0f);
                MobaMessageManager.ExecuteMsg(message);
            }
            else if (LoginType == 2)
            {
                MobaMessage message2 = MobaMessageManager.GetMessage((ClientMsg)21004, accountData, 0f);
                MobaMessageManager.ExecuteMsg(message2);
            }
            else if (LoginType == 3)
            {
                MobaMessage message3 = MobaMessageManager.GetMessage((ClientMsg)21005, accountData, 0f);
                MobaMessageManager.ExecuteMsg(message3);
            }
        }
Exemplo n.º 10
0
 private void onSubmit(GameObject obj = null)
 {
     this.data.iparam  = Convert.ToInt32(this.fontStyle.text);
     this.data.timeVal = Convert.ToInt32(this.lifeTime.text);
     this.data.Content = this.inputContentArea.text;
     MobaMessageManager.ExecuteMsg(MobaMessageManager.GetMessage((ClientMsg)23066, this.data, 0f));
 }
Exemplo n.º 11
0
        private void OnGetMsg_UsingEquipment(OperationResponse res)
        {
            base.LastError = (int)res.Parameters[1];
            List <EquipmentInfoData> list = (List <EquipmentInfoData>)base.Data;

            if (base.LastError == 0)
            {
                string            value             = res.Parameters[93] as string;
                long              eid               = Convert.ToInt64(value);
                EquipmentInfoData equipmentInfoData = list.Find((EquipmentInfoData obj) => obj.EquipmentId == eid);
                int modelId = equipmentInfoData.ModelId;
                if (equipmentInfoData != null && equipmentInfoData.Count > 1)
                {
                    equipmentInfoData.Count--;
                }
                else
                {
                    list.Remove(equipmentInfoData);
                }
                MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)23040, modelId, 0f);
                MobaMessageManager.ExecuteMsg(message);
                base.DebugMessage = "====>OK " + res.OperationCode;
            }
            else
            {
                Singleton <TipView> .Instance.ShowViewSetText("网络数据错误", 1f);

                base.DebugMessage = "====>UsingEquipment" + res.OperationCode;
            }
            base.Valid = (base.LastError == 0);
        }
Exemplo n.º 12
0
        private void P2C_Packages(MobaMessage msg)
        {
            OperationResponse operationResponse = msg.Param as OperationResponse;

            byte[]   buffer   = (byte[])operationResponse.Parameters[0];
            Packages packages = SerializeHelper.Deserialize <Packages>(buffer);

            FrameSyncManager.Instance.newNetFrameNum = ((!FrameSyncManager.Instance.UseFrame) ? packages.tick : packages.frameId);
            if (packages.packages != null)
            {
                if (!Singleton <PvpManager> .Instance.IsObserver)
                {
                }
                for (int i = 0; i < packages.packages.Length; i++)
                {
                    RelpayCmd   relpayCmd = packages.packages[i];
                    MobaMessage message   = MobaMessageManager.GetMessage((PvpCode)relpayCmd.code, relpayCmd.paramListBytes, 0f, null);
                    if (MobaMessageManager.IsHandlerExists(message))
                    {
                        FrameSyncManager.Instance.ReceiveMsg(message);
                    }
                    else if (!Singleton <PvpManager> .Instance.IsObserver)
                    {
                    }
                }
            }
            if (FrameSyncManager.Instance.WaitFrameTime || packages.packages != null)
            {
                FrameSyncManager.Instance.ReceiveMsg(MobaMessageManager.GetMessage(PvpCode.P2C_FrameSync, FrameSyncManager.Instance.newNetFrameNum, 0f, null));
            }
        }
Exemplo n.º 13
0
        private void OnGetMsg_DischargeRune(OperationResponse res)
        {
            base.LastError = (int)res.Parameters[1];
            List <EquipmentInfoData> list = (List <EquipmentInfoData>)base.Data;
            int num = (int)res.Parameters[109];

            if (base.LastError == 0)
            {
                int num2 = num;
                if (num2 != 1)
                {
                    if (num2 == 2)
                    {
                        List <EquipmentInfoData> listEquip = SerializeHelper.Deserialize <List <EquipmentInfoData> >(res.Parameters[84] as byte[]);
                        if (list != null && listEquip.Count > 0)
                        {
                            int i;
                            for (i = 0; i < listEquip.Count; i++)
                            {
                                EquipmentInfoData equipmentInfoData = list.Find((EquipmentInfoData obj) => obj.EquipmentId == listEquip[i].EquipmentId);
                                if (equipmentInfoData != null)
                                {
                                    equipmentInfoData.Count++;
                                }
                                else
                                {
                                    list.Add(listEquip[i]);
                                }
                            }
                            MobaMessageManagerTools.SendClientMsg(ClientC2V.RunesAllDemountEquip, null, false);
                        }
                    }
                }
                else
                {
                    EquipmentInfoData equipmentInfoData2 = SerializeHelper.Deserialize <EquipmentInfoData>(res.Parameters[90] as byte[]);
                    long eid = equipmentInfoData2.EquipmentId;
                    EquipmentInfoData equipmentInfoData3 = list.Find((EquipmentInfoData obj) => obj.EquipmentId == eid);
                    if (equipmentInfoData3 != null)
                    {
                        equipmentInfoData3.Count++;
                    }
                    else
                    {
                        list.Add(equipmentInfoData2);
                    }
                    MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)23041, equipmentInfoData2, 0f);
                    MobaMessageManager.ExecuteMsg(message);
                    base.DebugMessage = "====>OK " + res.OperationCode;
                }
            }
            else
            {
                Singleton <TipView> .Instance.ShowViewSetText("网络数据错误", 1f);

                base.DebugMessage = "====>Demount" + res.OperationCode;
            }
            base.Valid = (base.LastError == 0);
        }
        private void OnClick_Delete(GameObject obj = null)
        {
            this.deleteBtnFlag    = !this.deleteBtnFlag;
            this.ButtonLabel.text = ((!this.deleteBtnFlag) ? LanguageManager.Instance.GetStringById("LiveorPlayback_Playback003", "Edit") : LanguageManager.Instance.GetStringById("LiveorPlayback_Playback004", "Finish"));
            MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)26030, this.deleteBtnFlag, 0f);

            MobaMessageManager.ExecuteMsg(message);
        }
Exemplo n.º 15
0
    private void DelePhotonMsgGameCode(MobaGameCode msgID, object msgParam)
    {
        MobaMessage message = MobaMessageManager.GetMessage(msgID, msgParam, 0f);

        if (MobaMessageManager.IsHandlerExists(message))
        {
            MobaMessageManager.ExecuteMsg(message);
        }
    }
Exemplo n.º 16
0
 private void DispatchTimeOutMsg()
 {
     if (this._type != MobaMessageType.Client)
     {
         MsgData_WaitServerResponsTimeout msgParam = new MsgData_WaitServerResponsTimeout(this._type, this._code);
         MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)25012, msgParam, 0f);
         MobaMessageManager.DispatchMsg(message);
     }
 }
Exemplo n.º 17
0
 public override void OnDisconnected(MobaDisconnectedType dType)
 {
     this.ConnectFlag = false;
     MobaMessageManager.ExecuteMsg(MobaMessageManager.GetMessage((ClientMsg)20010, dType, 0f));
     if (this._enable && GateReconnection.CanTrigger && NetWorkHelper.Instance.GateReconnection.State == GateReconnection.ConnectState.End)
     {
         NetWorkHelper.Instance.GateReconnection.Begin();
     }
 }
Exemplo n.º 18
0
 /// <summary>
 /// master连接成功回调处理
 /// </summary>
 /// <param name="cType"></param>
 public override void OnConnected(MobaConnectedType cType)
 {
     if (cType != MobaConnectedType.ExceptionOnConnect)
     {
         this.ConnectFlag = true;
         MobaMessageManagerTools.EndWaiting_manual("ConnectMasterServer");
         MobaMessageManager.ExecuteMsg(MobaMessageManager.GetMessage((ClientMsg)20003, cType, 0f));
     }
 }
        public void SubmitShowSetting()
        {
            MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)26033, new object[]
            {
                this.LiveTitleInput.value,
                this.liveQualityRecord
            }, 0f);

            MobaMessageManager.ExecuteMsg(message);
            base.gameObject.SetActive(false);
        }
Exemplo n.º 20
0
 private void OnClick_Play(GameObject obj)
 {
     CtrlManager.ShowMsgBox("战场回放", "确定要打开本场战斗回放吗?(加载战斗回放不消耗流量)", delegate(bool _isConfirm)
     {
         if (!_isConfirm)
         {
             return;
         }
         MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)26032, this.ReplayId, 0f);
         MobaMessageManager.ExecuteMsg(message);
     }, PopViewType.PopTwoButton, "确定", "取消", null);
 }
Exemplo n.º 21
0
    private void ClickReport(GameObject _obj = null)
    {
        object[] msgParam = new object[]
        {
            this.mPlayerData,
            this._IsAlly
        };
        MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)21030, msgParam, 0f);

        MobaMessageManager.ExecuteMsg(message);
        MobaMessageManager.RegistMessage((ClientMsg)21031, new MobaMessageFunc(this.ConfirmReport));
    }
Exemplo n.º 22
0
 private void OnClick_Delete(GameObject obj)
 {
     CtrlManager.ShowMsgBox("删除确认", "确定删除本场战斗回放吗?", delegate(bool _isConfirm)
     {
         if (!_isConfirm)
         {
             return;
         }
         MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)26031, this, 0f);
         MobaMessageManager.ExecuteMsg(message);
     }, PopViewType.PopTwoButton, "确定", "取消", null);
 }
Exemplo n.º 23
0
 private void DelePhotonMsgCustom(Photon2ClientMsg msgID, object msgParam)
 {
     if (PvpServer.IsMultithreadEnabled)
     {
         this._storage.AddMsg((int)msgID, msgParam, MsgType.NotifyMsg, 0L);
     }
     else
     {
         MobaMessage message = MobaMessageManager.GetMessage(msgID, msgParam, 0f);
         MobaMessageManager.ExecuteMsg(message);
     }
 }
Exemplo n.º 24
0
        private void OnGetMsg_GameCode_DrawMagicBottleAward(MobaMessage msg)
        {
            base.LastError = 505;
            OperationResponse operationResponse;

            if (this.PreHandel(msg, out operationResponse))
            {
                base.LastError = (int)operationResponse.Parameters[1];
                if (base.LastError == 0)
                {
                    List <DropItemData>      list  = new List <DropItemData>();
                    List <EquipmentInfoData> list2 = new List <EquipmentInfoData>();
                    List <HeroInfoData>      list3 = new List <HeroInfoData>();
                    if (operationResponse.Parameters.ContainsKey(240))
                    {
                        list = SerializeHelper.Deserialize <List <DropItemData> >(operationResponse.Parameters[240] as byte[]);
                    }
                    if (operationResponse.Parameters.ContainsKey(202))
                    {
                        list2 = SerializeHelper.Deserialize <List <EquipmentInfoData> >(operationResponse.Parameters[202] as byte[]);
                    }
                    if (operationResponse.Parameters.ContainsKey(88))
                    {
                        list3 = SerializeHelper.Deserialize <List <HeroInfoData> >(operationResponse.Parameters[88] as byte[]);
                    }
                    int num = (int)operationResponse.Parameters[241];
                    if (list != null)
                    {
                        this.data.normalDrop = list;
                    }
                    if (list2 != null)
                    {
                        this.data.equipList = list2;
                    }
                    if (list3 != null)
                    {
                        this.data.heroinfoList = list3;
                    }
                    List <DropItemData> list4 = SerializeHelper.Deserialize <List <DropItemData> >(operationResponse.Parameters[146] as byte[]);
                    if (list4 != null && list4.Count != 0)
                    {
                        this.data.repeatDrop = list4;
                    }
                    MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)23051, new List <object>
                    {
                        num,
                        list
                    }, 0f);
                    MobaMessageManager.ExecuteMsg(message);
                }
            }
        }
Exemplo n.º 25
0
    private void DelePhotonMsgUserDataCode(MobaUserDataCode msgID, object msgParam)
    {
        MobaMessage message = MobaMessageManager.GetMessage(msgID, msgParam, 0f);

        if (MobaMessageManager.IsHandlerExists(message))
        {
            MobaMessageManager.ExecuteMsg(message);
        }
        else
        {
            ClientLogger.Error("No handler for MobaUserDataCode: " + msgID);
        }
    }
Exemplo n.º 26
0
    public void ApplyChange()
    {
        List <ItemDynData>   equipList = this.EquipList;
        IEnumerable <string> source    = from x in equipList
                                         select x.typeId;
        List <string> equips = source.ToList <string>();

        BattleEquipTools_op.ApplyEquipsToHero(equips, (Hero)this.self);
        this.self.SetItemSkill(this.EquipList);
        HeroItemsChangedData msgParam = new HeroItemsChangedData(this.self.unique_id, equipList);

        MobaMessageManager.DispatchMsg(MobaMessageManager.GetMessage((ClientMsg)25043, msgParam, 0f));
    }
Exemplo n.º 27
0
        private void OnGetMsg_WearPrivateEffect(OperationResponse res)
        {
            base.LastError = (int)res.Parameters[1];
            List <EquipmentInfoData> list = (List <EquipmentInfoData>)base.Data;

            if (base.LastError == 0)
            {
                int num     = (int)res.Parameters[10];
                int modelid = (int)res.Parameters[93];
                List <EquipmentInfoData> list2 = base.Data as List <EquipmentInfoData>;
                if (num == 1)
                {
                    EquipmentInfoData equipmentInfoData = list2.Find((EquipmentInfoData obj) => obj.ModelId == modelid);
                    equipmentInfoData.isweared = 1;
                    if (equipmentInfoData != null && equipmentInfoData.Count > 1)
                    {
                        equipmentInfoData.Count--;
                    }
                    else
                    {
                        list2.Remove(equipmentInfoData);
                    }
                    MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)23058, equipmentInfoData, 0f);
                    MobaMessageManager.ExecuteMsg(message);
                }
                if (num == 2)
                {
                    EquipmentInfoData equipmentinfodata  = SerializeHelper.Deserialize <EquipmentInfoData>(res.Parameters[90] as byte[]);
                    EquipmentInfoData equipmentInfoData2 = list2.Find((EquipmentInfoData obj) => obj.EquipmentId == equipmentinfodata.EquipmentId);
                    if (equipmentInfoData2 != null)
                    {
                        equipmentInfoData2.isweared = 1;
                        equipmentInfoData2.Count++;
                    }
                    else
                    {
                        equipmentInfoData2 = equipmentinfodata;
                        list2.Add(equipmentInfoData2);
                    }
                    MobaMessage message2 = MobaMessageManager.GetMessage((ClientMsg)23059, equipmentInfoData2, 0f);
                    MobaMessageManager.ExecuteMsg(message2);
                }
                base.Data         = list2;
                base.DebugMessage = "====>OK " + res.OperationCode;
            }
            else
            {
                base.DebugMessage = "====>Demount" + res.OperationCode;
            }
            base.Valid = (base.LastError == 0);
        }
Exemplo n.º 28
0
    public static void SendClientMsg(object code, object param = null, bool dispatch = false)
    {
        ClientMsg   msgID   = (ClientMsg)((int)code);
        MobaMessage message = MobaMessageManager.GetMessage(msgID, param, 0f);

        if (dispatch)
        {
            MobaMessageManager.DispatchMsg(message);
        }
        else
        {
            MobaMessageManager.ExecuteMsg(message);
        }
    }
Exemplo n.º 29
0
    protected float SetAttr(DataManager.DataPoolType dataPoolType, AttrType attrType, float value)
    {
        if (CharacterDataMgr.instance != null && dataPoolType == DataManager.DataPoolType.CurrentData)
        {
            AttrNumberData attrNumberData = CharacterDataMgr.instance.GetAttrNumberData(attrType);
            if (attrNumberData != null)
            {
                if (value > attrNumberData.m_fMaxValue)
                {
                    value = attrNumberData.m_fMaxValue;
                }
                else if (value < attrNumberData.m_fMinValue)
                {
                    value = attrNumberData.m_fMinValue;
                }
            }
        }
        this._dataPool[(int)dataPoolType][(int)attrType] = value;
        if (dataPoolType == DataManager.DataPoolType.CurrentData && this.self.isPlayer)
        {
            switch (attrType)
            {
            case AttrType.Attack:
            case AttrType.Armor:
            case AttrType.MoveSpeed:
            case AttrType.AttackSpeed:
                goto IL_AA;

            case AttrType.DodgeProp:
IL_90:
                switch (attrType)
                {
                case AttrType.MagicResist:
                case AttrType.MagicPower:
                    goto IL_AA;
                }
                return(value);
            }
            goto IL_90;
IL_AA:
            MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)25057, new MsgData_AttrChangeData
            {
                nType  = (int)attrType,
                fValue = value
            }, 0f);
            MobaMessageManager.ExecuteMsg(message);
        }
        return(value);
    }
Exemplo n.º 30
0
 public override void OnConnected(MobaConnectedType cType)
 {
     if (cType != MobaConnectedType.ExceptionOnConnect)
     {
         this.ConnectFlag = true;
         if (cType == MobaConnectedType.Original)
         {
             this._client.IsReconnect = true;
         }
         else if (cType != MobaConnectedType.Multi || NetWorkHelper.Instance.client.IsReconnect)
         {
         }
         MobaMessageManager.ExecuteMsg(MobaMessageManager.GetMessage((ClientMsg)20009, cType, 0f));
     }
 }