public override void Serialize(IDataWriter writer) { byte flag1 = 0; flag1 = BooleanByteWrapper.SetFlag(flag1, 0, enabled); flag1 = BooleanByteWrapper.SetFlag(flag1, 1, abandonnedPaddock); writer.WriteByte(flag1); writer.WriteByte(level); writer.WriteVarLong(expLevelFloor); writer.WriteVarLong(experience); writer.WriteVarLong(expNextLevelFloor); writer.WriteInt(creationDate); writer.WriteVarShort(nbTotalMembers); writer.WriteVarShort(nbConnectedMembers); }
public override void Serialize(ICustomDataOutput writer) { byte flag1 = 0; flag1 = BooleanByteWrapper.SetFlag(flag1, 0, hasRights); flag1 = BooleanByteWrapper.SetFlag(flag1, 1, wasAlreadyConnected); writer.WriteByte(flag1); writer.WriteUTF(login); writer.WriteUTF(nickname); writer.WriteInt(accountId); writer.WriteSByte(communityId); writer.WriteUTF(secretQuestion); writer.WriteDouble(accountCreation); writer.WriteDouble(subscriptionElapsedDuration); writer.WriteDouble(subscriptionEndDate); }
public override void Deserialize(ICustomDataInput reader) { byte flag1 = reader.ReadByte(); activate = BooleanByteWrapper.GetFlag(flag1, 0); party = BooleanByteWrapper.GetFlag(flag1, 1); reason = reader.ReadSByte(); if (reason < 0) { throw new Exception("Forbidden value on reason = " + reason + ", it doesn't respect the following condition : reason < 0"); } idolId = reader.ReadVarUhShort(); if (idolId < 0) { throw new Exception("Forbidden value on idolId = " + idolId + ", it doesn't respect the following condition : idolId < 0"); } }
public override void Deserialize(ICustomDataInput reader) { byte flag1 = reader.ReadByte(); canBeCancelled = BooleanByteWrapper.GetFlag(flag1, 0); canSayReady = BooleanByteWrapper.GetFlag(flag1, 1); isFightStarted = BooleanByteWrapper.GetFlag(flag1, 2); timeMaxBeforeFightStart = reader.ReadShort(); if (timeMaxBeforeFightStart < 0) { throw new Exception("Forbidden value on timeMaxBeforeFightStart = " + timeMaxBeforeFightStart + ", it doesn't respect the following condition : timeMaxBeforeFightStart < 0"); } fightType = reader.ReadSByte(); if (fightType < 0) { throw new Exception("Forbidden value on fightType = " + fightType + ", it doesn't respect the following condition : fightType < 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_; }
public override void Deserialize(IDataReader reader) { base.Deserialize(reader); byte flag1 = reader.ReadByte(); silentCast = BooleanByteWrapper.GetFlag(flag1, 0); verboseCast = BooleanByteWrapper.GetFlag(flag1, 1); targetId = reader.ReadDouble(); if (targetId < -9007199254740990 || targetId > 9007199254740990) { throw new Exception("Forbidden value on targetId = " + targetId + ", it doesn't respect the following condition : targetId < -9007199254740990 || targetId > 9007199254740990"); } destinationCellId = reader.ReadShort(); if (destinationCellId < -1 || destinationCellId > 559) { throw new Exception("Forbidden value on destinationCellId = " + destinationCellId + ", it doesn't respect the following condition : destinationCellId < -1 || destinationCellId > 559"); } critical = reader.ReadSByte(); }
public override void Deserialize(IDataReader 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.ReadVarLong(); if (expLevelFloor < 0 || expLevelFloor > 9007199254740990) { throw new Exception("Forbidden value on expLevelFloor = " + expLevelFloor + ", it doesn't respect the following condition : expLevelFloor < 0 || expLevelFloor > 9007199254740990"); } experience = reader.ReadVarLong(); if (experience < 0 || experience > 9007199254740990) { throw new Exception("Forbidden value on experience = " + experience + ", it doesn't respect the following condition : experience < 0 || experience > 9007199254740990"); } expNextLevelFloor = reader.ReadVarLong(); if (expNextLevelFloor < 0 || expNextLevelFloor > 9007199254740990) { throw new Exception("Forbidden value on expNextLevelFloor = " + expNextLevelFloor + ", it doesn't respect the following condition : expNextLevelFloor < 0 || expNextLevelFloor > 9007199254740990"); } creationDate = reader.ReadInt(); if (creationDate < 0) { throw new Exception("Forbidden value on creationDate = " + creationDate + ", it doesn't respect the following condition : creationDate < 0"); } nbTotalMembers = reader.ReadVarShort(); if (nbTotalMembers < 0) { throw new Exception("Forbidden value on nbTotalMembers = " + nbTotalMembers + ", it doesn't respect the following condition : nbTotalMembers < 0"); } nbConnectedMembers = reader.ReadVarShort(); if (nbConnectedMembers < 0) { throw new Exception("Forbidden value on nbConnectedMembers = " + nbConnectedMembers + ", it doesn't respect the following condition : nbConnectedMembers < 0"); } }
public override void Deserialize(IDataReader 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.ReadUShort(); var credentials_ = new sbyte[limit]; for (int i = 0; i < limit; i++) { credentials_[i] = reader.ReadSByte(); } credentials = credentials_; serverId = reader.ReadShort(); }
public override void Serialize(ICustomDataOutput writer) { byte flag1 = 0; flag1 = BooleanByteWrapper.SetFlag(flag1, 0, self); flag1 = BooleanByteWrapper.SetFlag(flag1, 1, verbose); writer.WriteByte(flag1); writer.WriteSByte(position); writer.WriteUTF(accountNickname); writer.WriteInt(accountId); writer.WriteUTF(playerName); writer.WriteVarUhInt(playerId); writer.WriteShort(areaId); writer.WriteUShort((ushort)socialGroups.Count()); foreach (var entry in socialGroups) { writer.WriteShort(entry.TypeId); entry.Serialize(writer); } writer.WriteSByte(playerState); }
public override void Deserialize(IDataReader 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 > 9007199254740990) { throw new Exception("Forbidden value on accountCreation = " + accountCreation + ", it doesn't respect the following condition : accountCreation < 0 || accountCreation > 9007199254740990"); } subscriptionElapsedDuration = reader.ReadDouble(); if (subscriptionElapsedDuration < 0 || subscriptionElapsedDuration > 9007199254740990) { throw new Exception("Forbidden value on subscriptionElapsedDuration = " + subscriptionElapsedDuration + ", it doesn't respect the following condition : subscriptionElapsedDuration < 0 || subscriptionElapsedDuration > 9007199254740990"); } subscriptionEndDate = reader.ReadDouble(); if (subscriptionEndDate < 0 || subscriptionEndDate > 9007199254740990) { throw new Exception("Forbidden value on subscriptionEndDate = " + subscriptionEndDate + ", it doesn't respect the following condition : subscriptionEndDate < 0 || subscriptionEndDate > 9007199254740990"); } havenbagAvailableRoom = reader.ReadByte(); if (havenbagAvailableRoom < 0 || havenbagAvailableRoom > 255) { throw new Exception("Forbidden value on havenbagAvailableRoom = " + havenbagAvailableRoom + ", it doesn't respect the following condition : havenbagAvailableRoom < 0 || havenbagAvailableRoom > 255"); } }
public override void Deserialize(IDataReader reader) { byte flag1 = reader.ReadByte(); secondHand = BooleanByteWrapper.GetFlag(flag1, 0); bought = BooleanByteWrapper.GetFlag(flag1, 1); houseId = reader.ReadVarInt(); if (houseId < 0) { throw new Exception("Forbidden value on houseId = " + houseId + ", it doesn't respect the following condition : houseId < 0"); } instanceId = reader.ReadInt(); if (instanceId < 0) { throw new Exception("Forbidden value on instanceId = " + instanceId + ", it doesn't respect the following condition : instanceId < 0"); } realPrice = reader.ReadVarLong(); if (realPrice < 0 || realPrice > 9007199254740990) { throw new Exception("Forbidden value on realPrice = " + realPrice + ", it doesn't respect the following condition : realPrice < 0 || realPrice > 9007199254740990"); } }
public override void Deserialize(IDataReader reader) { byte flag1 = reader.ReadByte(); buyOrSell = BooleanByteWrapper.GetFlag(flag1, 0); secondHand = BooleanByteWrapper.GetFlag(flag1, 1); purchasableId = reader.ReadVarInt(); if (purchasableId < 0) { throw new Exception("Forbidden value on purchasableId = " + purchasableId + ", it doesn't respect the following condition : purchasableId < 0"); } purchasableInstanceId = reader.ReadInt(); if (purchasableInstanceId < 0) { throw new Exception("Forbidden value on purchasableInstanceId = " + purchasableInstanceId + ", it doesn't respect the following condition : purchasableInstanceId < 0 || purchasableInstanceId > 4294967295"); } price = reader.ReadVarLong(); if (price < 0 || price > 9007199254740990) { throw new Exception("Forbidden value on price = " + price + ", it doesn't respect the following condition : price < 0 || price > 9007199254740990"); } }
public override void Deserialize(ICustomDataInput reader) { byte flag1 = reader.ReadByte(); tutorialAvailable = BooleanByteWrapper.GetFlag(flag1, 0); canCreateNewCharacter = BooleanByteWrapper.GetFlag(flag1, 1); accountId = reader.ReadInt(); if (accountId < 0) { throw new Exception("Forbidden value on accountId = " + accountId + ", it doesn't respect the following condition : accountId < 0"); } breedsVisible = reader.ReadUShort(); if (breedsVisible < 0 || breedsVisible > 65535) { throw new Exception("Forbidden value on breedsVisible = " + breedsVisible + ", it doesn't respect the following condition : breedsVisible < 0 || breedsVisible > 65535"); } breedsAvailable = reader.ReadUShort(); if (breedsAvailable < 0 || breedsAvailable > 65535) { throw new Exception("Forbidden value on breedsAvailable = " + breedsAvailable + ", it doesn't respect the following condition : breedsAvailable < 0 || breedsAvailable > 65535"); } status = reader.ReadSByte(); }
public override void Serialize(ICustomDataOutput writer) { byte flag1 = 0; flag1 = BooleanByteWrapper.SetFlag(flag1, 0, autoconnect); flag1 = BooleanByteWrapper.SetFlag(flag1, 1, useCertificate); flag1 = BooleanByteWrapper.SetFlag(flag1, 2, useLoginToken); writer.WriteByte(flag1); version.Serialize(writer); writer.WriteUTF(lang); writer.WriteVarInt(credentials.Count()); foreach (var entry in credentials) { writer.WriteSByte(entry); } writer.WriteShort(serverId); writer.WriteVarLong(sessionOptionalSalt); writer.WriteUShort((ushort)failedAttempts.Count()); foreach (var entry in failedAttempts) { writer.WriteVarUhShort(entry); } }
public override void Deserialize(IDataReader 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(); var credentials_ = new sbyte[limit]; for (int i = 0; i < limit; i++) { credentials_[i] = reader.ReadSByte(); } credentials = credentials_; serverId = reader.ReadShort(); sessionOptionalSalt = reader.ReadVarLong(); if (sessionOptionalSalt < -9007199254740990 || sessionOptionalSalt > 9007199254740990) { throw new Exception("Forbidden value on sessionOptionalSalt = " + sessionOptionalSalt + ", it doesn't respect the following condition : sessionOptionalSalt < -9007199254740990 || sessionOptionalSalt > 9007199254740990"); } limit = reader.ReadShort(); var failedAttempts_ = new short[limit]; for (int i = 0; i < limit; i++) { failedAttempts_[i] = reader.ReadVarShort(); if (failedAttempts_[i] < 0) { throw new Exception("Forbidden value on failedAttempts_[i] = " + failedAttempts_[i] + ", it doesn't respect the following condition : failedAttempts_[i] < 0"); } } failedAttempts = failedAttempts_; }
public override void Deserialize(IDataReader reader) { byte flag1 = reader.ReadByte(); self = BooleanByteWrapper.GetFlag(flag1, 0); verbose = BooleanByteWrapper.GetFlag(flag1, 1); position = reader.ReadSByte(); accountNickname = 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"); } playerName = reader.ReadUTF(); 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"); } areaId = reader.ReadShort(); serverId = reader.ReadShort(); originServerId = reader.ReadShort(); var limit = reader.ReadUShort(); var socialGroups_ = new Types.AbstractSocialGroupInfos[limit]; for (int i = 0; i < limit; i++) { socialGroups_[i] = Types.ProtocolTypeManager.GetInstance <Types.AbstractSocialGroupInfos>(reader.ReadShort()); socialGroups_[i].Deserialize(reader); } socialGroups = socialGroups_; playerState = reader.ReadSByte(); if (playerState < 0) { throw new Exception("Forbidden value on playerState = " + playerState + ", it doesn't respect the following condition : playerState < 0"); } }