public override void Deserialize(BigEndianReader reader)
        {
            byte flag1 = reader.ReadByte();

            hasRights           = BooleanByteWrapper.GetFlag(flag1, 0);
            wasAlreadyConnected = BooleanByteWrapper.GetFlag(flag1, 1);
            login     = reader.ReadUTF();
            nickname  = reader.ReadUTF();
            accountId = reader.ReadInt();
            if (accountId < 0)
            {
                throw new Exception("Forbidden value on accountId = " + accountId + ", it doesn't respect the following condition : accountId < 0");
            }
            communityId = reader.ReadSByte();
            if (communityId < 0)
            {
                throw new Exception("Forbidden value on communityId = " + communityId + ", it doesn't respect the following condition : communityId < 0");
            }
            secretQuestion  = reader.ReadUTF();
            accountCreation = reader.ReadDouble();
            if (accountCreation < 0 || accountCreation > 9.007199254740992E15)
            {
                throw new Exception("Forbidden value on accountCreation = " + accountCreation + ", it doesn't respect the following condition : accountCreation < 0 || accountCreation > 9.007199254740992E15");
            }
            subscriptionElapsedDuration = reader.ReadDouble();
            if (subscriptionElapsedDuration < 0 || subscriptionElapsedDuration > 9.007199254740992E15)
            {
                throw new Exception("Forbidden value on subscriptionElapsedDuration = " + subscriptionElapsedDuration + ", it doesn't respect the following condition : subscriptionElapsedDuration < 0 || subscriptionElapsedDuration > 9.007199254740992E15");
            }
            subscriptionEndDate = reader.ReadDouble();
            if (subscriptionEndDate < 0 || subscriptionEndDate > 9.007199254740992E15)
            {
                throw new Exception("Forbidden value on subscriptionEndDate = " + subscriptionEndDate + ", it doesn't respect the following condition : subscriptionEndDate < 0 || subscriptionEndDate > 9.007199254740992E15");
            }
        }
Ejemplo n.º 2
0
 public virtual void Deserialize(BigEndianReader reader)
 {
     jobId = reader.ReadSByte();
     if (jobId < 0)
     {
         throw new Exception("Forbidden value on jobId = " + jobId + ", it doesn't respect the following condition : jobId < 0");
     }
     jobLevel = reader.ReadSByte();
     if (jobLevel < 0)
     {
         throw new Exception("Forbidden value on jobLevel = " + jobLevel + ", it doesn't respect the following condition : jobLevel < 0");
     }
     jobXP = reader.ReadDouble();
     if (jobXP < 0)
     {
         throw new Exception("Forbidden value on jobXP = " + jobXP + ", it doesn't respect the following condition : jobXP < 0");
     }
     jobXpLevelFloor = reader.ReadDouble();
     if (jobXpLevelFloor < 0)
     {
         throw new Exception("Forbidden value on jobXpLevelFloor = " + jobXpLevelFloor + ", it doesn't respect the following condition : jobXpLevelFloor < 0");
     }
     jobXpNextLevelFloor = reader.ReadDouble();
     if (jobXpNextLevelFloor < 0)
     {
         throw new Exception("Forbidden value on jobXpNextLevelFloor = " + jobXpNextLevelFloor + ", it doesn't respect the following condition : jobXpNextLevelFloor < 0");
     }
 }
Ejemplo n.º 3
0
        public override void Deserialize(BigEndianReader reader)
        {
            byte flag1 = reader.ReadByte();

            enabled           = BooleanByteWrapper.GetFlag(flag1, 0);
            abandonnedPaddock = BooleanByteWrapper.GetFlag(flag1, 1);
            level             = reader.ReadByte();
            if (level < 0 || level > 255)
            {
                throw new Exception("Forbidden value on level = " + level + ", it doesn't respect the following condition : level < 0 || level > 255");
            }
            expLevelFloor = reader.ReadDouble();
            if (expLevelFloor < 0)
            {
                throw new Exception("Forbidden value on expLevelFloor = " + expLevelFloor + ", it doesn't respect the following condition : expLevelFloor < 0");
            }
            experience = reader.ReadDouble();
            if (experience < 0)
            {
                throw new Exception("Forbidden value on experience = " + experience + ", it doesn't respect the following condition : experience < 0");
            }
            expNextLevelFloor = reader.ReadDouble();
            if (expNextLevelFloor < 0)
            {
                throw new Exception("Forbidden value on expNextLevelFloor = " + expNextLevelFloor + ", it doesn't respect the following condition : expNextLevelFloor < 0");
            }
            creationDate = reader.ReadInt();
            if (creationDate < 0)
            {
                throw new Exception("Forbidden value on creationDate = " + creationDate + ", it doesn't respect the following condition : creationDate < 0");
            }
        }
 public override void Deserialize(BigEndianReader reader)
 {
     id = reader.ReadDouble();
     if (id < -9.007199254740992E15 || id > 9.007199254740992E15)
     {
         throw new Exception("Forbidden value on id = " + id + ", it doesn't respect the following condition : id < -9.007199254740992E15 || id > 9.007199254740992E15");
     }
     time = reader.ReadDouble();
     if (time < -9.007199254740992E15 || time > 9.007199254740992E15)
     {
         throw new Exception("Forbidden value on time = " + time + ", it doesn't respect the following condition : time < -9.007199254740992E15 || time > 9.007199254740992E15");
     }
 }
Ejemplo n.º 5
0
        public override void Deserialize(BigEndianReader reader)
        {
            byte flag = reader.ReadByte();

            m_hasRights           = BooleanByteWrapper.GetFlag(flag, 0);
            m_wasAlreadyConnected = BooleanByteWrapper.GetFlag(flag, 1);
            m_login                       = reader.ReadUTF();
            m_nickname                    = reader.ReadUTF();
            m_accountId                   = reader.ReadInt();
            m_communityId                 = reader.ReadByte();
            m_secretQuestion              = reader.ReadUTF();
            m_accountCreation             = reader.ReadDouble();
            m_subscriptionElapsedDuration = reader.ReadDouble();
            m_subscriptionEndDate         = reader.ReadDouble();
        }
Ejemplo n.º 6
0
        public override void Deserialize(BigEndianReader reader)
        {
            collectorName = reader.ReadUTF();
            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.ReadShort();
            if (subAreaId < 0)
            {
                throw new Exception("Forbidden value on subAreaId = " + subAreaId + ", it doesn't respect the following condition : subAreaId < 0");
            }
            userName   = reader.ReadUTF();
            experience = reader.ReadDouble();
            var limit = reader.ReadUShort();

            objectsInfos = new Types.ObjectItemQuantity[limit];
            for (int i = 0; i < limit; i++)
            {
                objectsInfos[i] = new Types.ObjectItemQuantity();
                objectsInfos[i].Deserialize(reader);
            }
        }
        public override void Deserialize(BigEndianReader reader)
        {
            byte flag1 = reader.ReadByte();

            autoconnect    = BooleanByteWrapper.GetFlag(flag1, 0);
            useCertificate = BooleanByteWrapper.GetFlag(flag1, 1);
            useLoginToken  = BooleanByteWrapper.GetFlag(flag1, 2);
            version        = new Types.VersionExtended();
            version.Deserialize(reader);
            lang = reader.ReadUTF();
            var limit = reader.ReadVarInt();

            credentials = new sbyte[limit];
            for (int i = 0; i < limit; i++)
            {
                credentials[i] = reader.ReadSByte();
            }
            serverId            = reader.ReadShort();
            sessionOptionalSalt = reader.ReadDouble();
            if (sessionOptionalSalt < -9.007199254740992E15 || sessionOptionalSalt > 9.007199254740992E15)
            {
                throw new Exception("Forbidden value on sessionOptionalSalt = " + sessionOptionalSalt + ", it doesn't respect the following condition : sessionOptionalSalt < -9.007199254740992E15 || sessionOptionalSalt > 9.007199254740992E15");
            }
            ushort length = reader.ReadUShort();

            failedAttempts = new List <short>();
            for (int i = 0; i < length; i++)
            {
                failedAttempts.Add(reader.ReadVarShort());
            }
        }
Ejemplo n.º 8
0
 public virtual void Deserialize(BigEndianReader reader)
 {
     id = reader.ReadUShort();
     if (id < 0 || id > 65535)
     {
         throw new Exception("Forbidden value on id = " + id + ", it doesn't respect the following condition : id < 0 || id > 65535");
     }
     status = reader.ReadSByte();
     if (status < 0)
     {
         throw new Exception("Forbidden value on status = " + status + ", it doesn't respect the following condition : status < 0");
     }
     completion = reader.ReadSByte();
     if (completion < 0)
     {
         throw new Exception("Forbidden value on completion = " + completion + ", it doesn't respect the following condition : completion < 0");
     }
     isSelectable    = reader.ReadBoolean();
     charactersCount = reader.ReadSByte();
     if (charactersCount < 0)
     {
         throw new Exception("Forbidden value on charactersCount = " + charactersCount + ", it doesn't respect the following condition : charactersCount < 0");
     }
     date = reader.ReadDouble();
 }
Ejemplo n.º 9
0
 public override void Deserialize(BigEndianReader reader)
 {
     mountId = reader.ReadDouble();
     if (mountId < -9.007199254740992E15 || mountId > 9.007199254740992E15)
     {
         throw new Exception("Forbidden value on mountId = " + mountId + ", it doesn't respect the following condition : mountId < -9.007199254740992E15 || mountId > 9.007199254740992E15");
     }
 }
 public override void Deserialize(BigEndianReader reader)
 {
     base.Deserialize(reader);
     banEndDate = reader.ReadDouble();
     if (banEndDate < 0 || banEndDate > 9.007199254740992E15)
     {
         throw new Exception("Forbidden value on banEndDate = " + banEndDate + ", it doesn't respect the following condition : banEndDate < 0 || banEndDate > 9.007199254740992E15");
     }
 }
Ejemplo n.º 11
0
 public override void Deserialize(BigEndianReader reader)
 {
     base.Deserialize(reader);
     value = reader.ReadDouble();
     if (value < -9.007199254740992E15 || value > 9.007199254740992E15)
     {
         throw new Exception("Forbidden value on value = " + value + ", it doesn't respect the following condition : value < -9.007199254740992E15 || value > 9.007199254740992E15");
     }
 }
Ejemplo n.º 12
0
 public override void Deserialize(BigEndianReader reader)
 {
     emoteId = reader.ReadSByte();
     if (emoteId < 0)
     {
         throw new Exception("Forbidden value on emoteId = " + emoteId + ", it doesn't respect the following condition : emoteId < 0");
     }
     emoteStartTime = reader.ReadDouble();
 }
Ejemplo n.º 13
0
 public override void Deserialize(BigEndianReader reader)
 {
     timestamp = reader.ReadDouble();
     if (timestamp < 0 || timestamp > 9.007199254740992E15)
     {
         throw new Exception("Forbidden value on timestamp = " + timestamp + ", it doesn't respect the following condition : timestamp < 0 || timestamp > 9.007199254740992E15");
     }
     timezoneOffset = reader.ReadShort();
 }
Ejemplo n.º 14
0
 public override void Deserialize(BigEndianReader reader)
 {
     m_ObjectId        = reader.ReadVarUShort();
     m_status          = reader.ReadByte();
     m_completion      = reader.ReadByte();
     m_isSelectable    = reader.ReadBoolean();
     m_charactersCount = reader.ReadByte();
     m_date            = reader.ReadDouble();
 }
Ejemplo n.º 15
0
        public List <Amf0Object> ReadAmf0(bool rootobject = false)
        {
            List <Amf0Object> retlist = new List <Amf0Object>();

            while (true)
            {
                Amf0Object ret = new Amf0Object();
                if (br.Remaining < 2 && rootobject)
                {
                    return(retlist);
                }
                ret.name = Encoding.ASCII.GetString(br.ReadBytes(br.ReadInt16())); //object name
                ret.type = (Amf0Object.Amf0Type)br.ReadByte();                     //type
                switch (ret.type)
                {
                case Amf0Object.Amf0Type.AMF0_NUMBER:                        //NUMBER
                    ret.data = br.ReadDouble();
                    break;

                case Amf0Object.Amf0Type.AMF0_BOOLEAN:                        //BOOLEAN
                    ret.data = br.ReadBoolean();
                    break;

                case Amf0Object.Amf0Type.AMF0_STRING:
                    ret.data = Encoding.UTF8.GetString(br.ReadBytes(br.ReadInt16()));
                    break;

                case Amf0Object.Amf0Type.AMF0_OBJECT:                        //OBJECT
                {
                    ret.data = ReadAmf0();
                }
                break;

                case Amf0Object.Amf0Type.AMF0_NULL:
                case Amf0Object.Amf0Type.AMF0_UNDEFINED:
                    ret.data = null;
                    break;

                case Amf0Object.Amf0Type.AMF0_ECMA_ARRAY:                        //ecma array
                {
                    br.ReadInt32();
                    var ecma = ReadAmf0();
                    ret.data = ecma;
                    //							if (ecma.Count != l)
                    //								throw new Exception("Corrupt ECMA array in SOL file");
                }
                break;

                case Amf0Object.Amf0Type.AMF0_OBJECT_END:
                    return(retlist);

                default:
                    throw new Exception("Error reading SOL file (40)");
                }
                retlist.Add(ret);
            }
        }
Ejemplo n.º 16
0
 public override void Deserialize(BigEndianReader reader)
 {
     fightId = reader.ReadDouble();
     if (fightId < 0)
     {
         throw new Exception("Forbidden value on fightId = " + fightId + ", it doesn't respect the following condition : fightId < 0");
     }
     playerInfo = new Types.CharacterMinimalPlusLookInformations();
     playerInfo.Deserialize(reader);
 }
Ejemplo n.º 17
0
 public override void Deserialize(BigEndianReader reader)
 {
     subAreaId = reader.ReadShort();
     if (subAreaId < 0)
     {
         throw new Exception("Forbidden value on subAreaId = " + subAreaId + ", it doesn't respect the following condition : subAreaId < 0");
     }
     fightId  = reader.ReadDouble();
     attacker = Types.ProtocolTypeManager.GetInstance <Types.CharacterMinimalPlusLookInformations>(reader.ReadShort());
     attacker.Deserialize(reader);
 }
Ejemplo n.º 18
0
        public override void Deserialize(BigEndianReader reader)
        {
            rideId = reader.ReadDouble();
            var limit = reader.ReadUShort();

            boostToUpdateList = new Types.UpdateMountBoost[limit];
            for (int i = 0; i < limit; i++)
            {
                boostToUpdateList[i] = Types.ProtocolTypeManager.GetInstance <Types.UpdateMountBoost>(reader.ReadShort());
                boostToUpdateList[i].Deserialize(reader);
            }
        }
Ejemplo n.º 19
0
        public override void Deserialize(BigEndianReader reader)
        {
            base.Deserialize(reader);
            byte flag1 = reader.ReadByte();

            showExperience               = BooleanByteWrapper.GetFlag(flag1, 0);
            showExperienceLevelFloor     = BooleanByteWrapper.GetFlag(flag1, 1);
            showExperienceNextLevelFloor = BooleanByteWrapper.GetFlag(flag1, 2);
            showExperienceFightDelta     = BooleanByteWrapper.GetFlag(flag1, 3);
            showExperienceForGuild       = BooleanByteWrapper.GetFlag(flag1, 4);
            showExperienceForMount       = BooleanByteWrapper.GetFlag(flag1, 5);
            isIncarnationExperience      = BooleanByteWrapper.GetFlag(flag1, 6);
            experience = reader.ReadDouble();
            if (experience < 0)
            {
                throw new Exception("Forbidden value on experience = " + experience + ", it doesn't respect the following condition : experience < 0");
            }
            experienceLevelFloor = reader.ReadDouble();
            if (experienceLevelFloor < 0)
            {
                throw new Exception("Forbidden value on experienceLevelFloor = " + experienceLevelFloor + ", it doesn't respect the following condition : experienceLevelFloor < 0");
            }
            experienceNextLevelFloor = reader.ReadDouble();
            if (experienceNextLevelFloor < 0)
            {
                throw new Exception("Forbidden value on experienceNextLevelFloor = " + experienceNextLevelFloor + ", it doesn't respect the following condition : experienceNextLevelFloor < 0");
            }
            experienceFightDelta = reader.ReadInt();
            experienceForGuild   = reader.ReadInt();
            if (experienceForGuild < 0)
            {
                throw new Exception("Forbidden value on experienceForGuild = " + experienceForGuild + ", it doesn't respect the following condition : experienceForGuild < 0");
            }
            experienceForMount = reader.ReadInt();
            if (experienceForMount < 0)
            {
                throw new Exception("Forbidden value on experienceForMount = " + experienceForMount + ", it doesn't respect the following condition : experienceForMount < 0");
            }
            rerollExperienceMul = reader.ReadInt();
        }
 public override void Deserialize(BigEndianReader reader)
 {
     fightId = reader.ReadDouble();
     if (fightId < 0)
     {
         throw new Exception("Forbidden value on fightId = " + fightId + ", it doesn't respect the following condition : fightId < 0");
     }
     playerId = reader.ReadInt();
     if (playerId < 0)
     {
         throw new Exception("Forbidden value on playerId = " + playerId + ", it doesn't respect the following condition : playerId < 0");
     }
 }
Ejemplo n.º 21
0
 public override void Deserialize(BigEndianReader reader)
 {
     emoteId = reader.ReadByte();
     if (emoteId < 0 || emoteId > 255)
     {
         throw new Exception("Forbidden value on emoteId = " + emoteId + ", it doesn't respect the following condition : emoteId < 0 || emoteId > 255");
     }
     emoteStartTime = reader.ReadDouble();
     if (emoteStartTime < -9.007199254740992E15 || emoteStartTime > 9.007199254740992E15)
     {
         throw new Exception("Forbidden value on emoteStartTime = " + emoteStartTime + ", it doesn't respect the following condition : emoteStartTime < -9.007199254740992E15 || emoteStartTime > 9.007199254740992E15");
     }
 }
 public override void Deserialize(BigEndianReader reader)
 {
     experienceCharacter = reader.ReadDouble();
     if (experienceCharacter < 0)
     {
         throw new Exception("Forbidden value on experienceCharacter = " + experienceCharacter + ", it doesn't respect the following condition : experienceCharacter < 0");
     }
     experienceMount = reader.ReadDouble();
     if (experienceMount < 0)
     {
         throw new Exception("Forbidden value on experienceMount = " + experienceMount + ", it doesn't respect the following condition : experienceMount < 0");
     }
     experienceGuild = reader.ReadDouble();
     if (experienceGuild < 0)
     {
         throw new Exception("Forbidden value on experienceGuild = " + experienceGuild + ", it doesn't respect the following condition : experienceGuild < 0");
     }
     experienceIncarnation = reader.ReadDouble();
     if (experienceIncarnation < 0)
     {
         throw new Exception("Forbidden value on experienceIncarnation = " + experienceIncarnation + ", it doesn't respect the following condition : experienceIncarnation < 0");
     }
 }
Ejemplo n.º 23
0
 public override void Deserialize(BigEndianReader reader)
 {
     subAreaId = reader.ReadShort();
     if (subAreaId < 0)
     {
         throw new Exception("Forbidden value on subAreaId = " + subAreaId + ", it doesn't respect the following condition : subAreaId < 0");
     }
     fightId           = reader.ReadDouble();
     fighterToRemoveId = reader.ReadInt();
     if (fighterToRemoveId < 0)
     {
         throw new Exception("Forbidden value on fighterToRemoveId = " + fighterToRemoveId + ", it doesn't respect the following condition : fighterToRemoveId < 0");
     }
 }
 public override void Deserialize(BigEndianReader reader)
 {
     delayedCharacterId = reader.ReadInt();
     delayTypeId        = reader.ReadSByte();
     if (delayTypeId < 0)
     {
         throw new Exception("Forbidden value on delayTypeId = " + delayTypeId + ", it doesn't respect the following condition : delayTypeId < 0");
     }
     delayEndTime = reader.ReadDouble();
     if (delayEndTime < 0)
     {
         throw new Exception("Forbidden value on delayEndTime = " + delayEndTime + ", it doesn't respect the following condition : delayEndTime < 0");
     }
 }
Ejemplo n.º 25
0
 public override void Deserialize(BigEndianReader reader)
 {
     base.Deserialize(reader);
     mountId = reader.ReadInt();
     if (mountId < 0)
     {
         throw new Exception("Forbidden value on mountId = " + mountId + ", it doesn't respect the following condition : mountId < 0");
     }
     date    = reader.ReadDouble();
     modelId = reader.ReadShort();
     if (modelId < 0)
     {
         throw new Exception("Forbidden value on modelId = " + modelId + ", it doesn't respect the following condition : modelId < 0");
     }
 }
        public override void Deserialize(BigEndianReader reader)
        {
            fightId = reader.ReadDouble();
            if (fightId < 0)
            {
                throw new Exception("Forbidden value on fightId = " + fightId + ", it doesn't respect the following condition : fightId < 0");
            }
            var limit = reader.ReadUShort();

            playerInfo = new Types.CharacterMinimalPlusLookInformations[limit];
            for (int i = 0; i < limit; i++)
            {
                playerInfo[i] = new Types.CharacterMinimalPlusLookInformations();
                playerInfo[i].Deserialize(reader);
            }
        }
Ejemplo n.º 27
0
        public override void Deserialize(BigEndianReader reader)
        {
            rideId = reader.ReadDouble();
            if (rideId < -9.007199254740992E15 || rideId > 9.007199254740992E15)
            {
                throw new Exception("Forbidden value on rideId = " + rideId + ", it doesn't respect the following condition : rideId < -9.007199254740992E15 || rideId > 9.007199254740992E15");
            }
            var limit = reader.ReadUShort();

            boostToUpdateList = new Types.UpdateMountBoost[limit];
            for (int i = 0; i < limit; i++)
            {
                boostToUpdateList[i] = Types.ProtocolTypeManager.GetInstance <Types.UpdateMountBoost>(reader.ReadShort());
                boostToUpdateList[i].Deserialize(reader);
            }
        }
Ejemplo n.º 28
0
        public override void Deserialize(BigEndianReader reader)
        {
            var limit = reader.ReadUShort();

            alliances = new Types.AllianceInformations[limit];
            for (int i = 0; i < limit; i++)
            {
                alliances[i] = new Types.AllianceInformations();
                alliances[i].Deserialize(reader);
            }
            limit             = reader.ReadUShort();
            allianceNbMembers = new short[limit];
            for (int i = 0; i < limit; i++)
            {
                allianceNbMembers[i] = reader.ReadVarShort();
            }
            limit = reader.ReadUShort();
            allianceRoundWeigth = new int[limit];
            for (int i = 0; i < limit; i++)
            {
                allianceRoundWeigth[i] = reader.ReadVarInt();
            }
            limit = reader.ReadUShort();
            allianceMatchScore = new sbyte[limit];
            for (int i = 0; i < limit; i++)
            {
                allianceMatchScore[i] = reader.ReadSByte();
            }
            allianceMapWinner = new Types.BasicAllianceInformations();
            allianceMapWinner.Deserialize(reader);
            allianceMapWinnerScore = reader.ReadVarInt();
            if (allianceMapWinnerScore < 0)
            {
                throw new Exception("Forbidden value on allianceMapWinnerScore = " + allianceMapWinnerScore + ", it doesn't respect the following condition : allianceMapWinnerScore < 0");
            }
            allianceMapMyAllianceScore = reader.ReadVarInt();
            if (allianceMapMyAllianceScore < 0)
            {
                throw new Exception("Forbidden value on allianceMapMyAllianceScore = " + allianceMapMyAllianceScore + ", it doesn't respect the following condition : allianceMapMyAllianceScore < 0");
            }
            nextTickTime = reader.ReadDouble();
            if (nextTickTime < 0 || nextTickTime > 9.007199254740992E15)
            {
                throw new Exception("Forbidden value on nextTickTime = " + nextTickTime + ", it doesn't respect the following condition : nextTickTime < 0 || nextTickTime > 9.007199254740992E15");
            }
        }
Ejemplo n.º 29
0
 public override void Deserialize(BigEndianReader reader)
 {
     base.Deserialize(reader);
     breed = reader.ReadSByte();
     sex   = reader.ReadBoolean();
     rank  = reader.ReadShort();
     if (rank < 0)
     {
         throw new Exception("Forbidden value on rank = " + rank + ", it doesn't respect the following condition : rank < 0");
     }
     givenExperience = reader.ReadDouble();
     if (givenExperience < 0)
     {
         throw new Exception("Forbidden value on givenExperience = " + givenExperience + ", it doesn't respect the following condition : givenExperience < 0");
     }
     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.ReadUInt();
     if (rights < 0 || rights > 4.294967295E9)
     {
         throw new Exception("Forbidden value on rights = " + rights + ", it doesn't respect the following condition : rights < 0 || rights > 4.294967295E9");
     }
     connected = reader.ReadSByte();
     if (connected < 0)
     {
         throw new Exception("Forbidden value on connected = " + connected + ", it doesn't respect the following condition : connected < 0");
     }
     alignmentSide            = reader.ReadSByte();
     hoursSinceLastConnection = reader.ReadUShort();
     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.ReadSByte();
     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 <Types.PlayerStatus>(reader.ReadShort());
     status.Deserialize(reader);
 }
Ejemplo n.º 30
0
 public override void Deserialize(BigEndianReader reader)
 {
     base.Deserialize(reader);
     maxPods = reader.ReadShort();
     if (maxPods < 0)
     {
         throw new Exception("Forbidden value on maxPods = " + maxPods + ", it doesn't respect the following condition : maxPods < 0");
     }
     prospecting = reader.ReadShort();
     if (prospecting < 0)
     {
         throw new Exception("Forbidden value on prospecting = " + prospecting + ", it doesn't respect the following condition : prospecting < 0");
     }
     wisdom = reader.ReadShort();
     if (wisdom < 0)
     {
         throw new Exception("Forbidden value on wisdom = " + wisdom + ", it doesn't respect the following condition : wisdom < 0");
     }
     taxCollectorsCount = reader.ReadSByte();
     if (taxCollectorsCount < 0)
     {
         throw new Exception("Forbidden value on taxCollectorsCount = " + taxCollectorsCount + ", it doesn't respect the following condition : taxCollectorsCount < 0");
     }
     taxCollectorAttack = reader.ReadInt();
     kamas = reader.ReadInt();
     if (kamas < 0)
     {
         throw new Exception("Forbidden value on kamas = " + kamas + ", it doesn't respect the following condition : kamas < 0");
     }
     experience = reader.ReadDouble();
     if (experience < 0)
     {
         throw new Exception("Forbidden value on experience = " + experience + ", it doesn't respect the following condition : experience < 0");
     }
     pods = reader.ReadInt();
     if (pods < 0)
     {
         throw new Exception("Forbidden value on pods = " + pods + ", it doesn't respect the following condition : pods < 0");
     }
     itemsValue = reader.ReadInt();
     if (itemsValue < 0)
     {
         throw new Exception("Forbidden value on itemsValue = " + itemsValue + ", it doesn't respect the following condition : itemsValue < 0");
     }
 }