Ejemplo n.º 1
0
        public virtual void Deserialize(IDataReader reader)
        {
            dareId = reader.ReadDouble();
            if (dareId < 0 || dareId > 9007199254740990)
            {
                throw new Exception("Forbidden value on dareId = " + dareId + ", it doesn't respect the following condition : dareId < 0 || dareId > 9007199254740990");
            }
            creator = new Types.CharacterBasicMinimalInformations();
            creator.Deserialize(reader);
            subscriptionFee = reader.ReadVarLong();
            if (subscriptionFee < 0 || subscriptionFee > 9007199254740990)
            {
                throw new Exception("Forbidden value on subscriptionFee = " + subscriptionFee + ", it doesn't respect the following condition : subscriptionFee < 0 || subscriptionFee > 9007199254740990");
            }
            jackpot = reader.ReadVarLong();
            if (jackpot < 0 || jackpot > 9007199254740990)
            {
                throw new Exception("Forbidden value on jackpot = " + jackpot + ", it doesn't respect the following condition : jackpot < 0 || jackpot > 9007199254740990");
            }
            maxCountWinners = reader.ReadShort();
            if (maxCountWinners < 0 || maxCountWinners > 65535)
            {
                throw new Exception("Forbidden value on maxCountWinners = " + maxCountWinners + ", it doesn't respect the following condition : maxCountWinners < 0 || maxCountWinners > 65535");
            }
            endDate = reader.ReadDouble();
            if (endDate < 0 || endDate > 9007199254740990)
            {
                throw new Exception("Forbidden value on endDate = " + endDate + ", it doesn't respect the following condition : endDate < 0 || endDate > 9007199254740990");
            }
            isPrivate = reader.ReadBoolean();
            guildId   = reader.ReadVarInt();
            if (guildId < 0)
            {
                throw new Exception("Forbidden value on guildId = " + guildId + ", it doesn't respect the following condition : guildId < 0");
            }
            allianceId = reader.ReadVarInt();
            if (allianceId < 0)
            {
                throw new Exception("Forbidden value on allianceId = " + allianceId + ", it doesn't respect the following condition : allianceId < 0");
            }
            var limit       = reader.ReadShort();
            var criterions_ = new Types.DareCriteria[limit];

            for (int i = 0; i < limit; i++)
            {
                criterions_[i] = new Types.DareCriteria();
                criterions_[i].Deserialize(reader);
            }
            criterions = criterions_;
            startDate  = reader.ReadDouble();
            if (startDate < 0 || startDate > 9007199254740990)
            {
                throw new Exception("Forbidden value on startDate = " + startDate + ", it doesn't respect the following condition : startDate < 0 || startDate > 9007199254740990");
            }
        }
Ejemplo n.º 2
0
        public override void Deserialize(IDataReader reader)
        {
            byte flag1 = reader.ReadByte();

            isPrivate         = BooleanByteWrapper.GetFlag(flag1, 0);
            isForGuild        = BooleanByteWrapper.GetFlag(flag1, 1);
            isForAlliance     = BooleanByteWrapper.GetFlag(flag1, 2);
            needNotifications = BooleanByteWrapper.GetFlag(flag1, 3);
            subscriptionFee   = reader.ReadVarLong();
            if (subscriptionFee < 0 || subscriptionFee > 9007199254740990)
            {
                throw new Exception("Forbidden value on subscriptionFee = " + subscriptionFee + ", it doesn't respect the following condition : subscriptionFee < 0 || subscriptionFee > 9007199254740990");
            }
            jackpot = reader.ReadVarLong();
            if (jackpot < 0 || jackpot > 9007199254740990)
            {
                throw new Exception("Forbidden value on jackpot = " + jackpot + ", it doesn't respect the following condition : jackpot < 0 || jackpot > 9007199254740990");
            }
            maxCountWinners = reader.ReadShort();
            if (maxCountWinners < 0 || maxCountWinners > 65535)
            {
                throw new Exception("Forbidden value on maxCountWinners = " + maxCountWinners + ", it doesn't respect the following condition : maxCountWinners < 0 || maxCountWinners > 65535");
            }
            delayBeforeStart = reader.ReadUInt();
            if (delayBeforeStart < 0 || delayBeforeStart > 4294967295)
            {
                throw new Exception("Forbidden value on delayBeforeStart = " + delayBeforeStart + ", it doesn't respect the following condition : delayBeforeStart < 0 || delayBeforeStart > 4294967295");
            }
            duration = reader.ReadUInt();
            if (duration < 0 || duration > 4294967295)
            {
                throw new Exception("Forbidden value on duration = " + duration + ", it doesn't respect the following condition : duration < 0 || duration > 4294967295");
            }
            var limit       = reader.ReadShort();
            var criterions_ = new Types.DareCriteria[limit];

            for (int i = 0; i < limit; i++)
            {
                criterions_[i] = new Types.DareCriteria();
                criterions_[i].Deserialize(reader);
            }
            criterions = criterions_;
        }
Ejemplo n.º 3
0
        public override void Deserialize(IDataReader reader)
        {
            byte flag1 = reader.ReadByte();

            isPrivate         = BooleanByteWrapper.GetFlag(flag1, 0);
            isForGuild        = BooleanByteWrapper.GetFlag(flag1, 1);
            isForAlliance     = BooleanByteWrapper.GetFlag(flag1, 2);
            needNotifications = BooleanByteWrapper.GetFlag(flag1, 3);
            subscriptionFee   = reader.ReadVarUhLong();
            jackpot           = reader.ReadVarUhLong();
            maxCountWinners   = reader.ReadUShort();
            delayBeforeStart  = reader.ReadUInt();
            duration          = reader.ReadUInt();
            var limit = (ushort)reader.ReadUShort();

            criterions = new Types.DareCriteria[limit];
            for (int i = 0; i < limit; i++)
            {
                criterions[i] = new Types.DareCriteria();
                criterions[i].Deserialize(reader);
            }
        }
Ejemplo n.º 4
0
        public virtual void Deserialize(IDataReader reader)
        {
            dareId  = reader.ReadDouble();
            creator = new Types.CharacterBasicMinimalInformations();
            creator.Deserialize(reader);
            subscriptionFee = reader.ReadVarUhLong();
            jackpot         = reader.ReadVarUhLong();
            maxCountWinners = reader.ReadUShort();
            endDate         = reader.ReadDouble();
            isPrivate       = reader.ReadBoolean();
            guildId         = reader.ReadVarUhInt();
            allianceId      = reader.ReadVarUhInt();
            var limit = (ushort)reader.ReadUShort();

            criterions = new Types.DareCriteria[limit];
            for (int i = 0; i < limit; i++)
            {
                criterions[i] = new Types.DareCriteria();
                criterions[i].Deserialize(reader);
            }
            startDate = reader.ReadDouble();
        }