示例#1
0
        public override void Deserialize(IDataReader reader)
        {
            base.Deserialize(reader);
            byte flag1 = reader.ReadByte();

            sex            = BooleanByteWrapper.GetFlag(flag1, 0);
            havenBagShared = BooleanByteWrapper.GetFlag(flag1, 1);
            playerId       = reader.ReadVarLong();
            if (playerId < 0 || playerId > 9007199254740990)
            {
                throw new Exception("Forbidden value on playerId = " + playerId + ", it doesn't respect the following condition : playerId < 0 || playerId > 9007199254740990");
            }
            playerName = reader.ReadUTF();
            level      = reader.ReadSByte();
            if (level < 0 || level > 206)
            {
                throw new Exception("Forbidden value on level = " + level + ", it doesn't respect the following condition : level < 0 || level > 206");
            }
            alignmentSide = reader.ReadSByte();
            breed         = reader.ReadSByte();
            guildInfo     = new Types.GuildInformations();
            guildInfo.Deserialize(reader);
            moodSmileyId = reader.ReadVarShort();
            if (moodSmileyId < 0)
            {
                throw new Exception("Forbidden value on moodSmileyId = " + moodSmileyId + ", it doesn't respect the following condition : moodSmileyId < 0");
            }
            status = Types.ProtocolTypeManager.GetInstance <PlayerStatus>(reader.ReadShort());
            status.Deserialize(reader);
        }
        public virtual void Deserialize(IDataReader reader)
        {
            guestId = reader.ReadVarLong();
            if (guestId < 0 || guestId > 9007199254740990)
            {
                throw new Exception("Forbidden value on guestId = " + guestId + ", it doesn't respect the following condition : guestId < 0 || guestId > 9007199254740990");
            }
            hostId = reader.ReadVarLong();
            if (hostId < 0 || hostId > 9007199254740990)
            {
                throw new Exception("Forbidden value on hostId = " + hostId + ", it doesn't respect the following condition : hostId < 0 || hostId > 9007199254740990");
            }
            name      = reader.ReadUTF();
            guestLook = new Types.EntityLook();
            guestLook.Deserialize(reader);
            breed  = reader.ReadSByte();
            sex    = reader.ReadBoolean();
            status = Types.ProtocolTypeManager.GetInstance <PlayerStatus>(reader.ReadShort());
            status.Deserialize(reader);
            var limit       = reader.ReadShort();
            var companions_ = new Types.PartyCompanionBaseInformations[limit];

            for (int i = 0; i < limit; i++)
            {
                companions_[i] = new Types.PartyCompanionBaseInformations();
                companions_[i].Deserialize(reader);
            }
            companions = companions_;
        }
示例#3
0
 public virtual void Deserialize(IDataReader reader)
 {
     playerId = reader.ReadVarLong();
     if (playerId < 0 || playerId > 9007199254740990)
     {
         throw new Exception("Forbidden value on playerId = " + playerId + ", it doesn't respect the following condition : playerId < 0 || playerId > 9007199254740990");
     }
     playerName    = reader.ReadUTF();
     alignmentSide = reader.ReadSByte();
     breed         = reader.ReadSByte();
     sex           = reader.ReadBoolean();
     isInWorkshop  = reader.ReadBoolean();
     worldX        = reader.ReadShort();
     if (worldX < -255 || worldX > 255)
     {
         throw new Exception("Forbidden value on worldX = " + worldX + ", it doesn't respect the following condition : worldX < -255 || worldX > 255");
     }
     worldY = reader.ReadShort();
     if (worldY < -255 || worldY > 255)
     {
         throw new Exception("Forbidden value on worldY = " + worldY + ", it doesn't respect the following condition : worldY < -255 || worldY > 255");
     }
     mapId     = reader.ReadInt();
     subAreaId = reader.ReadVarShort();
     if (subAreaId < 0)
     {
         throw new Exception("Forbidden value on subAreaId = " + subAreaId + ", it doesn't respect the following condition : subAreaId < 0");
     }
     status = Types.ProtocolTypeManager.GetInstance <PlayerStatus>(reader.ReadShort());
     status.Deserialize(reader);
 }
        public override void Deserialize(IDataReader reader)
        {
            base.Deserialize(reader);
            lifePoints = reader.ReadVarInt();
            if (lifePoints < 0)
            {
                throw new Exception("Forbidden value on lifePoints = " + lifePoints + ", it doesn't respect the following condition : lifePoints < 0");
            }
            maxLifePoints = reader.ReadVarInt();
            if (maxLifePoints < 0)
            {
                throw new Exception("Forbidden value on maxLifePoints = " + maxLifePoints + ", it doesn't respect the following condition : maxLifePoints < 0");
            }
            prospecting = reader.ReadVarShort();
            if (prospecting < 0)
            {
                throw new Exception("Forbidden value on prospecting = " + prospecting + ", it doesn't respect the following condition : prospecting < 0");
            }
            regenRate = reader.ReadSByte();
            if (regenRate < 0 || regenRate > 255)
            {
                throw new Exception("Forbidden value on regenRate = " + regenRate + ", it doesn't respect the following condition : regenRate < 0 || regenRate > 255");
            }
            initiative = reader.ReadVarShort();
            if (initiative < 0)
            {
                throw new Exception("Forbidden value on initiative = " + initiative + ", it doesn't respect the following condition : initiative < 0");
            }
            alignmentSide = reader.ReadSByte();
            worldX        = reader.ReadShort();
            if (worldX < -255 || worldX > 255)
            {
                throw new Exception("Forbidden value on worldX = " + worldX + ", it doesn't respect the following condition : worldX < -255 || worldX > 255");
            }
            worldY = reader.ReadShort();
            if (worldY < -255 || worldY > 255)
            {
                throw new Exception("Forbidden value on worldY = " + worldY + ", it doesn't respect the following condition : worldY < -255 || worldY > 255");
            }
            mapId     = reader.ReadInt();
            subAreaId = reader.ReadVarShort();
            if (subAreaId < 0)
            {
                throw new Exception("Forbidden value on subAreaId = " + subAreaId + ", it doesn't respect the following condition : subAreaId < 0");
            }
            status = Types.ProtocolTypeManager.GetInstance <PlayerStatus>(reader.ReadShort());
            status.Deserialize(reader);
            var limit       = reader.ReadShort();
            var companions_ = new Types.PartyCompanionMemberInformations[limit];

            for (int i = 0; i < limit; i++)
            {
                companions_[i] = new Types.PartyCompanionMemberInformations();
                companions_[i].Deserialize(reader);
            }
            companions = companions_;
        }
示例#5
0
        public override void Deserialize(IDataReader reader)
        {
            base.Deserialize(reader);
            byte flag1 = reader.ReadByte();

            sex            = BooleanByteWrapper.GetFlag(flag1, 0);
            havenBagShared = BooleanByteWrapper.GetFlag(flag1, 1);
            breed          = reader.ReadSByte();
            rank           = reader.ReadVarShort();
            if (rank < 0)
            {
                throw new Exception("Forbidden value on rank = " + rank + ", it doesn't respect the following condition : rank < 0");
            }
            givenExperience = reader.ReadVarLong();
            if (givenExperience < 0 || givenExperience > 9007199254740990)
            {
                throw new Exception("Forbidden value on givenExperience = " + givenExperience + ", it doesn't respect the following condition : givenExperience < 0 || givenExperience > 9007199254740990");
            }
            experienceGivenPercent = reader.ReadSByte();
            if (experienceGivenPercent < 0 || experienceGivenPercent > 100)
            {
                throw new Exception("Forbidden value on experienceGivenPercent = " + experienceGivenPercent + ", it doesn't respect the following condition : experienceGivenPercent < 0 || experienceGivenPercent > 100");
            }
            rights = reader.ReadVarInt();
            if (rights < 0)
            {
                throw new Exception("Forbidden value on rights = " + rights + ", it doesn't respect the following condition : rights < 0");
            }
            connected                = reader.ReadSByte();
            alignmentSide            = reader.ReadSByte();
            hoursSinceLastConnection = reader.ReadShort();
            if (hoursSinceLastConnection < 0 || hoursSinceLastConnection > 65535)
            {
                throw new Exception("Forbidden value on hoursSinceLastConnection = " + hoursSinceLastConnection + ", it doesn't respect the following condition : hoursSinceLastConnection < 0 || hoursSinceLastConnection > 65535");
            }
            moodSmileyId = reader.ReadVarShort();
            if (moodSmileyId < 0)
            {
                throw new Exception("Forbidden value on moodSmileyId = " + moodSmileyId + ", it doesn't respect the following condition : moodSmileyId < 0");
            }
            accountId = reader.ReadInt();
            if (accountId < 0)
            {
                throw new Exception("Forbidden value on accountId = " + accountId + ", it doesn't respect the following condition : accountId < 0");
            }
            achievementPoints = reader.ReadInt();
            status            = Types.ProtocolTypeManager.GetInstance <PlayerStatus>(reader.ReadShort());
            status.Deserialize(reader);
        }