Ejemplo n.º 1
0
        public void OnKinApply(int nNewKinID)
        {
            ActorPlayerInfo playerData = LogicDataCenter.playerSystemDataManager.GetActorPlayerInfo();

            if (playerData.playerInfo.pDbid == 0)
            {
                return;
            }

            cmd_kin_apply data = new cmd_kin_apply();

            data.nOldKinID = m_kinBaseData.nKinID;
            data.nKinID    = nNewKinID;
            data.szName    = playerData.playerInfo.chPlayerName;
            data.nLevel    = (byte)EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_LEVEL);
            data.nVocation = (byte)EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_VOCATION);
            ViewEventHelper.Instance.SendCommand <cmd_kin_apply>(GameLogicDef.GVIEWCMD_KIN_APPLY, ref data);
        }
Ejemplo n.º 2
0
        public void RequestHeroDetailInfo(PDBIDandHeroID nMultiKey, HeroDetailReqType eType = HeroDetailReqType.HDRT_INIT)
        {
            // 设置详细英雄界面信息请求标志位
            eHeroDetailReqType = eType;

            cmd_entity_hero_info cmdHeroInfo = new cmd_entity_hero_info();

            // Player界面取一次
            ActorPlayerInfo playerInfo = null;

            if (actorPlayer.TryGetValue(nMultiKey.nPDBID, out playerInfo))
            {
                foreach (var value in playerInfo.strongHeroInfoList)
                {
                    if (value.nHeroID == nMultiKey.nHeroID)
                    {
                        cmdHeroInfo = value;
                        break;
                    }
                }
            }

            // Hero界面取一次
            if (cmdHeroInfo.nHeroID == 0)
            {
                ActorHeroInfo heroInfo = null;
                if (actorHero.TryGetValue(nMultiKey.nPDBID, out heroInfo))
                {
                    heroInfo.dicEntityHeroInfo.TryGetValue(nMultiKey.nHeroID, out cmdHeroInfo);
                }
            }

            // nHeroID > 0,则表示该英雄有数据;bIsBuy > 0,则表示已购买
            cmd_Request_Hero_Detail_Info reqHeroDetailInfo = new cmd_Request_Hero_Detail_Info();

            reqHeroDetailInfo.nActorID = (uint)nMultiKey.nPDBID;
            reqHeroDetailInfo.nHeroID  = nMultiKey.nHeroID;
            reqHeroDetailInfo.heroInfo = cmdHeroInfo;

            EntityEventHelper.Instance.SendCommand <cmd_Request_Hero_Detail_Info>(EntityFactory.MainHeroID, EntityLogicDef.ENTITY_CMD_QUERY_HERO_DETAIL_INFO, ref reqHeroDetailInfo);
        }
Ejemplo n.º 3
0
        public ActorPlayerInfo GetActorPlayerInfo(int actorID = nDefaultSelfActorID)
        {
            CheckGetSelfPDBID(ref actorID);

            ActorPlayerInfo info = null;

            if (actorPlayer.TryGetValue(actorID, out info))
            {
                return(info);
            }
            else
            {
                info                    = new ActorPlayerInfo();
                info.playerInfo         = new cmd_player_info_return();
                info.strongHeroInfoList = new List <cmd_entity_hero_info>();
                actorPlayer[actorID]    = info;
            }

            RequestPlayerInfo(actorID);
            return(info);
        }
Ejemplo n.º 4
0
        public void UpdatePlayerInfo(IntPtr ptrParam, int nPtrLen)
        {
            IntPtrVaArgParseHelper helper = new IntPtrVaArgParseHelper(ptrParam, nPtrLen);

            cmd_player_info_return playerInfo = helper.get <cmd_player_info_return>();
            ActorPlayerInfo        info       = null;

            if (actorPlayer.TryGetValue((int)playerInfo.pDbid, out info) == false)
            {
                return;
            }
            info.playerInfo = playerInfo;

            info.strongHeroInfoList.Clear();
            for (int i = 0; i < info.playerInfo.nCount; ++i)
            {
                cmd_entity_hero_info data = helper.get <cmd_entity_hero_info>();
                info.strongHeroInfoList.Add(data);
            }

            UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_PLAYERINFO_INITINFO, null);
        }
Ejemplo n.º 5
0
        public void UpdateHeroInfo(IntPtr ptrParam, int nPtrLen)
        {
            int actorID = EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_ID);

            IntPtrVaArgParseHelper helper = new IntPtrVaArgParseHelper(ptrParam, nPtrLen);

            int nCount = helper.get <int>();

            for (int i = 0; i < nCount; ++i)
            {
                bool bNewBuy = false;
                bool bOldBuy = false;

                cmd_entity_hero_info data     = helper.get <cmd_entity_hero_info>();
                ActorPlayerInfo      playInfo = null;
                ActorHeroInfo        info     = null;
                int nHeroID = data.nHeroID;
                bNewBuy = data.bIsBuy > 0;

                if (actorHero.TryGetValue(actorID, out info) == true)
                {
                    // 英雄总览界面数据更新
                    if (info.dicEntityHeroInfo.ContainsKey(nHeroID) == true)
                    {
                        bOldBuy = info.dicEntityHeroInfo[nHeroID].bIsBuy > 0;
                        info.dicEntityHeroInfo[nHeroID] = data;
                    }
                    else if (info.dicEntityNoHaveHeroInfo.ContainsKey(nHeroID) == true)
                    {
                        info.dicEntityNoHaveHeroInfo.Remove(nHeroID);
                        info.dicEntityHeroInfo[nHeroID] = data;
                    }
                }

                if ((actorPlayer.TryGetValue(actorID, out playInfo) == true))
                {
                    // 玩家界面数据更新
                    for (int j = 0; j < playInfo.strongHeroInfoList.Count; j++)
                    {
                        if (playInfo.strongHeroInfoList[j].nHeroID == nHeroID)
                        {
                            playInfo.strongHeroInfoList[j] = data;
                        }
                    }
                }

                PlayerHeroUpdateData msgData = new PlayerHeroUpdateData();
                msgData.nHeroID   = nHeroID;
                msgData.nReqPDBID = actorID;
                UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_HEROPREVIEWFRAME_GETHEROINFO, msgData);

                if (bNewBuy && !bOldBuy)
                {
                    UISystem.Instance.SendWndMessage(WndMsgID.WND_ID_GAMEWAITINGROOMVIEW_ROOMBUYHERO, msgData);
                }

                // 英雄详细界面数据更新
                PDBIDandHeroID multiKey = new PDBIDandHeroID(actorID, nHeroID);
                RequestHeroDetailInfo(multiKey, HeroDetailReqType.HDRT_REFRESH);
            }
        }