예제 #1
0
        /// <summary>
        /// 根据PkgPlayerBrief来初始化AOI数据
        /// </summary>
        public static UnitCacheInfo CreateUnitCacheInfo(PkgPlayerBrief info, Vector3 pos)
        {
            var cache_info = new xc.UnitCacheInfo(EUnitType.UNITTYPE_PLAYER, info.uuid);

            cache_info.CacheType               = xc.UnitCacheInfo.EType.ET_Create;
            cache_info.PosBorn                 = pos;
            cache_info.AOIPlayer.type_idx      = ActorHelper.RoleIdToTypeId(info.rid);
            cache_info.AOIPlayer.name          = System.Text.Encoding.UTF8.GetString(info.name);
            cache_info.AOIPlayer.model_id_list = new List <uint>();
            cache_info.AOIPlayer.fashions      = new List <uint>();
            ActorHelper.GetModelFashionList(info.shows, cache_info.AOIPlayer.model_id_list, cache_info.AOIPlayer.fashions);
            cache_info.AOIPlayer.suit_effects = info.effects;
            cache_info.AOIPlayer.level        = (short)info.level;
            cache_info.AOIPlayer.mount_id     = info.ride;
            cache_info.AOIPlayer.name_color   = info.name_color;
            cache_info.AOIPlayer.state        = info.state;
            cache_info.AOIPlayer.honor_id     = info.honor;
            cache_info.AOIPlayer.title_id     = info.title;
            cache_info.AOIPlayer.transfer_lv  = info.transfer;
            cache_info.AOIPlayer.mate_info    = info.mate;

            if (info.war != null)
            {
                cache_info.AOIPlayer.camp      = info.war.side;
                cache_info.AOIPlayer.team_id   = info.war.team_id;
                cache_info.AOIPlayer.pet_id    = info.war.pet_skin; //宠物皮肤
                cache_info.AOIPlayer.escort_id = info.war.escort_id;
            }
            else
            {
                cache_info.AOIPlayer.camp      = 0;
                cache_info.AOIPlayer.team_id   = 0;
                cache_info.AOIPlayer.pet_id    = 0;
                cache_info.AOIPlayer.escort_id = 0;
            }
            if (info.guild != null)
            {
                cache_info.AOIPlayer.guild_id   = info.guild.guild_id;
                cache_info.AOIPlayer.guild_name = System.Text.Encoding.UTF8.GetString(info.guild.guild_name);
            }
            else
            {
                cache_info.AOIPlayer.guild_id   = 0;
                cache_info.AOIPlayer.guild_name = "";
            }

            return(cache_info);
        }
예제 #2
0
        public PkgPlayerBrief GetPkgBrief(ushort protocol, byte[] data)
        {
            switch (protocol)
            {
            case NetMsg.MSG_PLAYER_QRY_PLAYER_BRIEF_MINI:
            {
                var            pack  = S2CPackBase.DeserializePack <S2CPlayerQryPlayerBriefMini>(data);
                PkgPlayerBrief brief = pack.info;

                return(brief);
            }

            default:
                return(null);
            }
        }
예제 #3
0
    /// <summary>
    ///  初始化角色职业id等信息
    /// </summary>
    private void SetData()
    {
        var role_ids = GameConstHelper.GetUintList("GAME_AVAILABLE_ROLE_ID");

        mActorNum = role_ids.Count;

        mRoleData = new List <PkgPlayerBrief>();
        for (int i = 0; i < mActorNum; ++i)
        {
            PkgPlayerBrief roleBrief = new PkgPlayerBrief();
            roleBrief.rid   = role_ids[i];
            roleBrief.uuid  = 0;
            roleBrief.name  = new byte[0];
            roleBrief.level = 0;

            mRoleData.Add(roleBrief);
        }
    }
예제 #4
0
 // 判断是否符合删除条件
 public bool IsCanRemove(PkgPlayerBrief pkgPlayerBrief)
 {
     //@hzb 服务端删除字段
     //return pkgPlayerBrief.level < 10 && pkgPlayerBrief.is_charge != 1;
     return(pkgPlayerBrief.level < 10);
 }
예제 #5
0
        /// <summary>
        /// 根据AOI信息更新本地玩家
        /// </summary>
        /// <param name="info"></param>
        void UpdateLocalPlayerAOIInfo(PkgPlayerBrief info)
        {
            var local_player = Game.Instance.GetLocalPlayer() as LocalPlayer;

            if (local_player == null)
            {
                return;
            }

            List <uint> model_list   = new List <uint>();
            List <uint> fashion_list = new List <uint>();

            ActorHelper.GetModelFashionList(info.shows, model_list, fashion_list);
            local_player.mAvatarCtrl.ChangeFacade(model_list, fashion_list, info.effects, local_player.VocationID);
            var client_model_set = ActorManager.Instance.ClientModelSet;

            foreach (var client_modle in client_model_set.Values)
            {
                if (client_modle != null && client_modle.RawUID == local_player.UID.obj_idx && client_modle.UpdateWithRawActor)
                {
                    client_modle.mAvatarCtrl.ChangeFacade(model_list, fashion_list, info.effects, local_player.VocationID);
                }
            }

            if (info.guild != null)
            {
                local_player.ActorAttribute.GuildId   = info.guild.guild_id;
                local_player.ActorAttribute.GuildName = System.Text.Encoding.UTF8.GetString(info.guild.guild_name);
            }
            else
            {
                local_player.ActorAttribute.GuildId   = 0;
                local_player.ActorAttribute.GuildName = "";
            }

            local_player.UpdateNameColor(info.name_color);

            local_player.ActorAttribute.Honor      = info.honor;
            local_player.ActorAttribute.Title      = info.title;
            local_player.ActorAttribute.TransferLv = info.transfer;

            local_player.MateInfo = info.mate;

            local_player.SetNameText();
            local_player.ActorAttribute.BattlePower = info.battle_power;
            local_player.ActorAttribute.Level       = info.level;

            uint oldEscortId = local_player.ActorAttribute.EscortId;

            if (info.war != null)
            {
                local_player.ActorAttribute.TeamId   = info.war.team_id;
                local_player.ActorAttribute.EscortId = info.war.escort_id;

                if (local_player != null)
                {
                    local_player.UpdateAOIAttrElement(info.war.attr_elm);
                }

                local_player.UpdateByBitState(info.bit_states);
                local_player.SetHeadIcons(Actor.EHeadIcon.TEAM);
                local_player.UpdatePetId(info.war.pet_skin);
            }
            else
            {
                local_player.ActorAttribute.TeamId   = 0;
                local_player.ActorAttribute.EscortId = 0;
            }
            if (oldEscortId != local_player.ActorAttribute.EscortId)
            {
                local_player.UpdateEscortNPC();
            }
            if (local_player.ActorAttribute.EscortId > 0)
            {
                // 如果有进行中的护送任务,则寻路做这个任务
                if (oldEscortId != local_player.ActorAttribute.EscortId)
                {
                    RouterManager.Instance.GenericGoToSysWindow(GameConst.SYS_OPEN_QUEST_ESCORT);
                }
            }

            local_player.SetHeadIcons(Actor.EHeadIcon.PEAK);

            LocalPlayerManager.Instance.LocalActorAttribute.EscortId = local_player.ActorAttribute.EscortId;

            local_player.MountId = info.ride;
        }
예제 #6
0
 public void RemoveApplicant(PkgPlayerBrief pkgPlayerBrief)
 {
     RemoveApplicant(pkgPlayerBrief.uuid);
 }