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.ReadShort(); var socialGroups_ = new AbstractSocialGroupInfos[limit]; for (int i = 0; i < limit; i++) { socialGroups_[i] = Types.ProtocolTypeManager.GetInstance <AbstractSocialGroupInfos>(reader.ReadShort()); socialGroups_[i].Deserialize(reader); } socialGroups = socialGroups_; playerState = reader.ReadSByte(); }
public override void Serialize(ICustomDataOutput writer) { byte flag = new byte(); BooleanByteWrapper.SetFlag(0, flag, m_self); BooleanByteWrapper.SetFlag(1, flag, m_verbose); writer.WriteByte(flag); writer.WriteShort(((short)(m_socialGroups.Count))); int socialGroupsIndex; for (socialGroupsIndex = 0; (socialGroupsIndex < m_socialGroups.Count); socialGroupsIndex = (socialGroupsIndex + 1)) { AbstractSocialGroupInfos objectToSend = m_socialGroups[socialGroupsIndex]; writer.WriteUShort(((ushort)(objectToSend.TypeID))); objectToSend.Serialize(writer); } writer.WriteByte(m_position); writer.WriteUTF(m_accountNickname); writer.WriteInt(m_accountId); writer.WriteUTF(m_playerName); writer.WriteVarUhLong(m_playerId); writer.WriteShort(m_areaId); writer.WriteShort(m_serverId); writer.WriteShort(m_originServerId); writer.WriteByte(m_playerState); }
public override void Deserialize(ICustomDataInput reader) { byte flag = reader.ReadByte(); m_self = BooleanByteWrapper.GetFlag(flag, 0); m_verbose = BooleanByteWrapper.GetFlag(flag, 1); int socialGroupsCount = reader.ReadUShort(); int socialGroupsIndex; m_socialGroups = new System.Collections.Generic.List <AbstractSocialGroupInfos>(); for (socialGroupsIndex = 0; (socialGroupsIndex < socialGroupsCount); socialGroupsIndex = (socialGroupsIndex + 1)) { AbstractSocialGroupInfos objectToAdd = ProtocolTypeManager.GetInstance <AbstractSocialGroupInfos>((short)reader.ReadUShort()); objectToAdd.Deserialize(reader); m_socialGroups.Add(objectToAdd); } m_position = reader.ReadByte(); m_accountNickname = reader.ReadUTF(); m_accountId = reader.ReadInt(); m_playerName = reader.ReadUTF(); m_playerId = reader.ReadVarUhLong(); m_areaId = reader.ReadShort(); m_serverId = reader.ReadShort(); m_originServerId = reader.ReadShort(); m_playerState = reader.ReadByte(); }
public override void Deserialize(ICustomDataInput reader) { byte box0 = reader.ReadByte(); Self = BooleanByteWrapper.GetFlag(box0, 1); Verbose = BooleanByteWrapper.GetFlag(box0, 2); Position = reader.ReadByte(); AccountNickname = reader.ReadUTF(); AccountId = reader.ReadInt(); PlayerName = reader.ReadUTF(); PlayerId = reader.ReadVarLong(); AreaId = reader.ReadShort(); ServerId = reader.ReadShort(); OriginServerId = reader.ReadShort(); var countSocialGroups = reader.ReadShort(); SocialGroups = new List <AbstractSocialGroupInfos>(); for (short i = 0; i < countSocialGroups; i++) { var socialGroupstypeId = reader.ReadShort(); AbstractSocialGroupInfos type = new AbstractSocialGroupInfos(); type.Deserialize(reader); SocialGroups.Add(type); } PlayerState = reader.ReadByte(); }
public override void Deserialize(IDataReader reader) { var flag = reader.ReadByte(); Self = BooleanByteWrapper.GetFlag(flag, 0);; Verbose = BooleanByteWrapper.GetFlag(flag, 1);; Position = reader.ReadSByte(); AccountNickname = reader.ReadUTF(); AccountId = reader.ReadInt(); PlayerName = reader.ReadUTF(); PlayerId = reader.ReadVarUhLong(); AreaId = reader.ReadShort(); ServerId = reader.ReadShort(); OriginServerId = reader.ReadShort(); var SocialGroupsCount = reader.ReadShort(); SocialGroups = new List <AbstractSocialGroupInfos>(); for (var i = 0; i < SocialGroupsCount; i++) { AbstractSocialGroupInfos objectToAdd = ProtocolTypeManager.GetInstance(reader.ReadUShort()); objectToAdd.Deserialize(reader); SocialGroups.Add(objectToAdd); } PlayerState = reader.ReadSByte(); }
public void Deserialize(IDataReader reader) { UInt32 wrappedBoolean = 0; wrappedBoolean = (UInt32)reader.ReadByte(); Self = BooleanByteWrapper.GetFlag(wrappedBoolean, 0); Position = (SByte)reader.ReadByte(); AccountNickname = reader.ReadUTF(); AccountId = (UInt32)reader.ReadInt(); PlayerName = reader.ReadUTF(); PlayerId = reader.ReadVarLong(); AreaId = reader.ReadShort(); ServerId = reader.ReadShort(); OriginServerId = reader.ReadShort(); SocialGroups = new AbstractSocialGroupInfos[reader.ReadShort()]; for (var i = 0; i < SocialGroups.Length; i++) { (SocialGroups[i] = new AbstractSocialGroupInfos()).Deserialize(reader); } wrappedBoolean = (UInt32)reader.ReadByte(); Verbose = BooleanByteWrapper.GetFlag(wrappedBoolean, 0); PlayerState = reader.ReadByte(); }
public override void Serialize(IDataWriter writer) { byte num = BooleanByteWrapper.SetFlag(0, 0, this.self); writer.WriteByte(BooleanByteWrapper.SetFlag(num, 1, this.verbose)); writer.WriteSByte(this.position); writer.WriteUTF(this.accountNickname); writer.WriteInt(this.accountId); writer.WriteUTF(this.playerName); writer.WriteVarLong(this.playerId); writer.WriteShort(this.areaId); writer.WriteShort(this.serverId); writer.WriteShort(this.originServerId); writer.WriteShort((short)((int)this.socialGroups.Length)); AbstractSocialGroupInfos[] abstractSocialGroupInfosArray = this.socialGroups; for (int i = 0; i < (int)abstractSocialGroupInfosArray.Length; i++) { AbstractSocialGroupInfos abstractSocialGroupInfo = abstractSocialGroupInfosArray[i]; writer.WriteShort(abstractSocialGroupInfo.TypeId); abstractSocialGroupInfo.Serialize(writer); } writer.WriteSByte(this.playerState); }
public override void Deserialize(IDataReader reader) { uint num1 = (uint)reader.ReadByte(); this.self = Burning.DofusProtocol.Network.BooleanByteWrapper.GetFlag((byte)num1, (byte)0); this.verbose = Burning.DofusProtocol.Network.BooleanByteWrapper.GetFlag((byte)num1, (byte)1); this.position = (int)reader.ReadByte(); this.accountNickname = reader.ReadUTF(); this.accountId = (uint)reader.ReadInt(); if (this.accountId < 0U) { throw new Exception("Forbidden value (" + (object)this.accountId + ") on element of BasicWhoIsMessage.accountId."); } this.playerName = reader.ReadUTF(); this.playerId = (double)reader.ReadVarUhLong(); if (this.playerId < 0.0 || this.playerId > 9.00719925474099E+15) { throw new Exception("Forbidden value (" + (object)this.playerId + ") on element of BasicWhoIsMessage.playerId."); } this.areaId = (int)reader.ReadShort(); this.serverId = (int)reader.ReadShort(); this.originServerId = (int)reader.ReadShort(); uint num2 = (uint)reader.ReadUShort(); for (int index = 0; (long)index < (long)num2; ++index) { AbstractSocialGroupInfos instance = ProtocolTypeManager.GetInstance <AbstractSocialGroupInfos>((uint)reader.ReadUShort()); instance.Deserialize(reader); this.socialGroups.Add(instance); } this.playerState = (uint)reader.ReadByte(); if (this.playerState < 0U) { throw new Exception("Forbidden value (" + (object)this.playerState + ") on element of BasicWhoIsMessage.playerState."); } }