public override void Deserialize(ICustomDataInput reader) { RequiredVersion = reader.ReadUInt(); if (RequiredVersion < 0) { throw new Exception("Forbidden value on RequiredVersion = " + RequiredVersion + ", it doesn't respect the following condition : requiredVersion < 0"); } CurrentVersion = reader.ReadUInt(); if (CurrentVersion < 0) { throw new Exception("Forbidden value on CurrentVersion = " + CurrentVersion + ", it doesn't respect the following condition : currentVersion < 0"); } }
public override void Deserialize(ICustomDataInput reader) { byte flag1 = reader.ReadByte(); this.isPrivate = BooleanByteWrapper.GetFlag(flag1, 0); this.isForGuild = BooleanByteWrapper.GetFlag(flag1, 1); this.isForAlliance = BooleanByteWrapper.GetFlag(flag1, 2); this.needNotifications = BooleanByteWrapper.GetFlag(flag1, 3); this.subscriptionFee = reader.ReadInt(); if (this.subscriptionFee < 0) { throw new Exception("Forbidden value on subscriptionFee = " + this.subscriptionFee + ", it doesn't respect the following condition : subscriptionFee < 0"); } this.jackpot = reader.ReadInt(); if (this.jackpot < 0) { throw new Exception("Forbidden value on jackpot = " + this.jackpot + ", it doesn't respect the following condition : jackpot < 0"); } this.maxCountWinners = reader.ReadUShort(); if (this.maxCountWinners < 0 || this.maxCountWinners > 65535) { throw new Exception("Forbidden value on maxCountWinners = " + this.maxCountWinners + ", it doesn't respect the following condition : maxCountWinners < 0 || maxCountWinners > 65535"); } this.delayBeforeStart = reader.ReadUInt(); if (this.delayBeforeStart < 0 || this.delayBeforeStart > 4294967295) { throw new Exception("Forbidden value on delayBeforeStart = " + this.delayBeforeStart + ", it doesn't respect the following condition : delayBeforeStart < 0 || delayBeforeStart > 4294967295"); } this.duration = reader.ReadUInt(); if (this.duration < 0 || this.duration > 4294967295) { throw new Exception("Forbidden value on duration = " + this.duration + ", it doesn't respect the following condition : duration < 0 || duration > 4294967295"); } var limit = reader.ReadUShort(); this.criterions = new DareCriteria[limit]; for (int i = 0; i < limit; i++) { this.criterions[i] = new DareCriteria(); this.criterions[i].Deserialize(reader); } }
public override void Deserialize(ICustomDataInput reader) { byte box0 = reader.ReadByte(); IsPrivate = BooleanByteWrapper.GetFlag(box0, 1); IsForGuild = BooleanByteWrapper.GetFlag(box0, 2); IsForAlliance = BooleanByteWrapper.GetFlag(box0, 3); NeedNotifications = BooleanByteWrapper.GetFlag(box0, 4); SubscriptionFee = reader.ReadVarLong(); Jackpot = reader.ReadVarLong(); MaxCountWinners = reader.ReadShort(); DelayBeforeStart = reader.ReadUInt(); Duration = reader.ReadUInt(); var countCriterions = reader.ReadShort(); Criterions = new List <DareCriteria>(); for (short i = 0; i < countCriterions; i++) { DareCriteria type = new DareCriteria(); type.Deserialize(reader); Criterions.Add(type); } }
public override void Deserialize(ICustomDataInput reader) { byte flag = reader.ReadByte(); m_isPrivate = BooleanByteWrapper.GetFlag(flag, 0); m_isForGuild = BooleanByteWrapper.GetFlag(flag, 1); m_isForAlliance = BooleanByteWrapper.GetFlag(flag, 2); m_needNotifications = BooleanByteWrapper.GetFlag(flag, 3); int criterionsCount = reader.ReadUShort(); int criterionsIndex; m_criterions = new System.Collections.Generic.List <DareCriteria>(); for (criterionsIndex = 0; (criterionsIndex < criterionsCount); criterionsIndex = (criterionsIndex + 1)) { DareCriteria objectToAdd = new DareCriteria(); objectToAdd.Deserialize(reader); m_criterions.Add(objectToAdd); } m_subscriptionFee = reader.ReadVarUhLong(); m_jackpot = reader.ReadVarUhLong(); m_maxCountWinners = reader.ReadUShort(); m_delayBeforeStart = reader.ReadUInt(); m_duration = reader.ReadUInt(); }
public override void Deserialize(ICustomDataInput reader) { base.Deserialize(reader); byte flag1 = reader.ReadByte(); keyRingBonus = BooleanByteWrapper.GetFlag(flag1, 0); hasHardcoreDrop = BooleanByteWrapper.GetFlag(flag1, 1); hasAVARewardToken = BooleanByteWrapper.GetFlag(flag1, 2); staticInfos = Types.ProtocolTypeManager.GetInstance <Types.GroupMonsterStaticInformations>(reader.ReadShort()); staticInfos.Deserialize(reader); creationDate = reader.ReadDouble(); ageBonusRate = reader.ReadUInt(); lootShare = reader.ReadSByte(); if ((lootShare < -1) || (lootShare > 8)) { throw new Exception("Forbidden value on lootShare = " + lootShare + ", it doesn't respect the following condition : (lootShare < -1) || (lootShare > 8)"); } alignmentSide = reader.ReadSByte(); }
public virtual void Deserialize(ICustomDataInput reader) { type = reader.ReadSByte(); if (type < 0) { throw new Exception("Forbidden value on type = " + type + ", it doesn't respect the following condition : type < 0"); } monsterId = reader.ReadVarUhShort(); if (monsterId < 0) { throw new Exception("Forbidden value on monsterId = " + monsterId + ", it doesn't respect the following condition : monsterId < 0"); } kamas = reader.ReadUInt(); if (kamas < 0 || kamas > 4294967295) { throw new Exception("Forbidden value on kamas = " + kamas + ", it doesn't respect the following condition : kamas < 0 || kamas > 4294967295"); } 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"); } }
public override void Deserialize(ICustomDataInput reader) { Id_ = reader.ReadVarShort(); Qty = reader.ReadUInt(); }