Example #1
0
 public static void Serialize(Stream stream, CacheExpireRequest instance)
 {
     if (instance.Account.Count > 0)
     {
         foreach (AccountId accountId in instance.Account)
         {
             stream.WriteByte(10);
             ProtocolParser.WriteUInt32(stream, accountId.GetSerializedSize());
             AccountId.Serialize(stream, accountId);
         }
     }
     if (instance.GameAccount.Count > 0)
     {
         foreach (GameAccountHandle gameAccountHandle in instance.GameAccount)
         {
             stream.WriteByte(18);
             ProtocolParser.WriteUInt32(stream, gameAccountHandle.GetSerializedSize());
             GameAccountHandle.Serialize(stream, gameAccountHandle);
         }
     }
     if (instance.Email.Count > 0)
     {
         foreach (string s in instance.Email)
         {
             stream.WriteByte(26);
             ProtocolParser.WriteBytes(stream, Encoding.UTF8.GetBytes(s));
         }
     }
 }
Example #2
0
        public override int GetHashCode()
        {
            int num = base.GetType().GetHashCode();

            using (List <AccountId> .Enumerator enumerator = this.Account.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    AccountId current = enumerator.get_Current();
                    num ^= current.GetHashCode();
                }
            }
            using (List <GameAccountHandle> .Enumerator enumerator2 = this.GameAccount.GetEnumerator())
            {
                while (enumerator2.MoveNext())
                {
                    GameAccountHandle current2 = enumerator2.get_Current();
                    num ^= current2.GetHashCode();
                }
            }
            using (List <string> .Enumerator enumerator3 = this.Email.GetEnumerator())
            {
                while (enumerator3.MoveNext())
                {
                    string current3 = enumerator3.get_Current();
                    num ^= current3.GetHashCode();
                }
            }
            return(num);
        }
        public static void Serialize(Stream stream, AccountReference instance)
        {
            BinaryWriter binaryWriter = new BinaryWriter(stream);

            if (instance.HasId)
            {
                stream.WriteByte(13);
                binaryWriter.Write(instance.Id);
            }
            if (instance.HasEmail)
            {
                stream.WriteByte(18);
                ProtocolParser.WriteBytes(stream, Encoding.UTF8.GetBytes(instance.Email));
            }
            if (instance.HasHandle)
            {
                stream.WriteByte(26);
                ProtocolParser.WriteUInt32(stream, instance.Handle.GetSerializedSize());
                GameAccountHandle.Serialize(stream, instance.Handle);
            }
            if (instance.HasBattleTag)
            {
                stream.WriteByte(34);
                ProtocolParser.WriteBytes(stream, Encoding.UTF8.GetBytes(instance.BattleTag));
            }
            if (instance.HasRegion)
            {
                stream.WriteByte(80);
                ProtocolParser.WriteUInt32(stream, instance.Region);
            }
        }
        public static GameAccountHandle DeserializeLengthDelimited(Stream stream)
        {
            GameAccountHandle gameAccountHandle = new GameAccountHandle();

            GameAccountHandle.DeserializeLengthDelimited(stream, gameAccountHandle);
            return(gameAccountHandle);
        }
        public static GameAccountHandle DeserializeLengthDelimited(Stream stream, GameAccountHandle instance)
        {
            long num = (long)((ulong)ProtocolParser.ReadUInt32(stream));

            num += stream.Position;
            return(GameAccountHandle.Deserialize(stream, instance, num));
        }
Example #6
0
 public static CacheExpireRequest Deserialize(Stream stream, CacheExpireRequest instance, long limit)
 {
     if (instance.Account == null)
     {
         instance.Account = new List <AccountId>();
     }
     if (instance.GameAccount == null)
     {
         instance.GameAccount = new List <GameAccountHandle>();
     }
     if (instance.Email == null)
     {
         instance.Email = new List <string>();
     }
     while (limit < 0L || stream.Position < limit)
     {
         int num = stream.ReadByte();
         if (num == -1)
         {
             if (limit >= 0L)
             {
                 throw new EndOfStreamException();
             }
             return(instance);
         }
         else if (num != 10)
         {
             if (num != 18)
             {
                 if (num != 26)
                 {
                     Key  key   = ProtocolParser.ReadKey((byte)num, stream);
                     uint field = key.Field;
                     if (field == 0u)
                     {
                         throw new ProtocolBufferException("Invalid field id: 0, something went wrong in the stream");
                     }
                     ProtocolParser.SkipKey(stream, key);
                 }
                 else
                 {
                     instance.Email.Add(ProtocolParser.ReadString(stream));
                 }
             }
             else
             {
                 instance.GameAccount.Add(GameAccountHandle.DeserializeLengthDelimited(stream));
             }
         }
         else
         {
             instance.Account.Add(AccountId.DeserializeLengthDelimited(stream));
         }
     }
     if (stream.Position == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
Example #7
0
 public static GameAccountSessionNotification Deserialize(Stream stream, GameAccountSessionNotification instance, long limit)
 {
     while (true)
     {
         if (limit < (long)0 || stream.Position < limit)
         {
             int num = stream.ReadByte();
             if (num == -1)
             {
                 if (limit >= (long)0)
                 {
                     throw new EndOfStreamException();
                 }
                 break;
             }
             else if (num == 10)
             {
                 if (instance.GameAccount != null)
                 {
                     GameAccountHandle.DeserializeLengthDelimited(stream, instance.GameAccount);
                 }
                 else
                 {
                     instance.GameAccount = GameAccountHandle.DeserializeLengthDelimited(stream);
                 }
             }
             else if (num != 18)
             {
                 Key key = ProtocolParser.ReadKey((byte)num, stream);
                 if (key.Field == 0)
                 {
                     throw new ProtocolBufferException("Invalid field id: 0, something went wrong in the stream");
                 }
                 ProtocolParser.SkipKey(stream, key);
             }
             else if (instance.SessionInfo != null)
             {
                 GameSessionUpdateInfo.DeserializeLengthDelimited(stream, instance.SessionInfo);
             }
             else
             {
                 instance.SessionInfo = GameSessionUpdateInfo.DeserializeLengthDelimited(stream);
             }
         }
         else
         {
             if (stream.Position != limit)
             {
                 throw new ProtocolBufferException("Read past max limit");
             }
             break;
         }
     }
     return(instance);
 }
        public static void Serialize(Stream stream, GameAccountHandle instance)
        {
            BinaryWriter binaryWriter = new BinaryWriter(stream);

            stream.WriteByte(13);
            binaryWriter.Write(instance.Id);
            stream.WriteByte(21);
            binaryWriter.Write(instance.Program);
            stream.WriteByte(24);
            ProtocolParser.WriteUInt32(stream, instance.Region);
        }
Example #9
0
        public static GameAccountHandle Deserialize(Stream stream, GameAccountHandle instance, long limit)
        {
            BinaryReader binaryReader = new BinaryReader(stream);

            while (limit < 0L || stream.get_Position() < limit)
            {
                int num = stream.ReadByte();
                if (num != -1)
                {
                    int num2 = num;
                    switch (num2)
                    {
                    case 21:
                        instance.Program = binaryReader.ReadUInt32();
                        continue;

                    case 22:
                    case 23:
                    {
IL_73:
                        if (num2 == 13)
                        {
                            instance.Id = binaryReader.ReadUInt32();
                            continue;
                        }
                        Key  key   = ProtocolParser.ReadKey((byte)num, stream);
                        uint field = key.Field;
                        if (field != 0u)
                        {
                            ProtocolParser.SkipKey(stream, key);
                            continue;
                        }
                        throw new ProtocolBufferException("Invalid field id: 0, something went wrong in the stream");
                    }

                    case 24:
                        instance.Region = ProtocolParser.ReadUInt32(stream);
                        continue;
                    }
                    goto IL_73;
                }
                if (limit >= 0L)
                {
                    throw new EndOfStreamException();
                }
                return(instance);
            }
            if (stream.get_Position() == limit)
            {
                return(instance);
            }
            throw new ProtocolBufferException("Read past max limit");
        }
 public static GameAccountSessionNotification Deserialize(Stream stream, GameAccountSessionNotification instance, long limit)
 {
     while (limit < 0L || stream.get_Position() < limit)
     {
         int num = stream.ReadByte();
         if (num == -1)
         {
             if (limit >= 0L)
             {
                 throw new EndOfStreamException();
             }
             return(instance);
         }
         else
         {
             int num2 = num;
             if (num2 != 10)
             {
                 if (num2 != 18)
                 {
                     Key  key   = ProtocolParser.ReadKey((byte)num, stream);
                     uint field = key.Field;
                     if (field == 0u)
                     {
                         throw new ProtocolBufferException("Invalid field id: 0, something went wrong in the stream");
                     }
                     ProtocolParser.SkipKey(stream, key);
                 }
                 else if (instance.SessionInfo == null)
                 {
                     instance.SessionInfo = GameSessionUpdateInfo.DeserializeLengthDelimited(stream);
                 }
                 else
                 {
                     GameSessionUpdateInfo.DeserializeLengthDelimited(stream, instance.SessionInfo);
                 }
             }
             else if (instance.GameAccount == null)
             {
                 instance.GameAccount = GameAccountHandle.DeserializeLengthDelimited(stream);
             }
             else
             {
                 GameAccountHandle.DeserializeLengthDelimited(stream, instance.GameAccount);
             }
         }
     }
     if (stream.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
        public static GameAccountHandle Deserialize(Stream stream, GameAccountHandle instance, long limit)
        {
            BinaryReader binaryReader = new BinaryReader(stream);

            while (limit < 0L || stream.Position < limit)
            {
                int num = stream.ReadByte();
                if (num == -1)
                {
                    if (limit >= 0L)
                    {
                        throw new EndOfStreamException();
                    }
                    return(instance);
                }
                else if (num != 13)
                {
                    if (num != 21)
                    {
                        if (num != 24)
                        {
                            Key  key   = ProtocolParser.ReadKey((byte)num, stream);
                            uint field = key.Field;
                            if (field == 0u)
                            {
                                throw new ProtocolBufferException("Invalid field id: 0, something went wrong in the stream");
                            }
                            ProtocolParser.SkipKey(stream, key);
                        }
                        else
                        {
                            instance.Region = ProtocolParser.ReadUInt32(stream);
                        }
                    }
                    else
                    {
                        instance.Program = binaryReader.ReadUInt32();
                    }
                }
                else
                {
                    instance.Id = binaryReader.ReadUInt32();
                }
            }
            if (stream.Position == limit)
            {
                return(instance);
            }
            throw new ProtocolBufferException("Read past max limit");
        }
 public static GameAccountList Deserialize(Stream stream, GameAccountList instance, long limit)
 {
     if (instance.Handle == null)
     {
         instance.Handle = new List <GameAccountHandle>();
     }
     while (limit < 0L || stream.get_Position() < limit)
     {
         int num = stream.ReadByte();
         if (num == -1)
         {
             if (limit >= 0L)
             {
                 throw new EndOfStreamException();
             }
             return(instance);
         }
         else
         {
             int num2 = num;
             if (num2 != 24)
             {
                 if (num2 != 34)
                 {
                     Key  key   = ProtocolParser.ReadKey((byte)num, stream);
                     uint field = key.Field;
                     if (field == 0u)
                     {
                         throw new ProtocolBufferException("Invalid field id: 0, something went wrong in the stream");
                     }
                     ProtocolParser.SkipKey(stream, key);
                 }
                 else
                 {
                     instance.Handle.Add(GameAccountHandle.DeserializeLengthDelimited(stream));
                 }
             }
             else
             {
                 instance.Region = ProtocolParser.ReadUInt32(stream);
             }
         }
     }
     if (stream.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
Example #13
0
 public static void Serialize(Stream stream, GameAccountSessionNotification instance)
 {
     if (instance.HasGameAccount)
     {
         stream.WriteByte(10);
         ProtocolParser.WriteUInt32(stream, instance.GameAccount.GetSerializedSize());
         GameAccountHandle.Serialize(stream, instance.GameAccount);
     }
     if (instance.HasSessionInfo)
     {
         stream.WriteByte(18);
         ProtocolParser.WriteUInt32(stream, instance.SessionInfo.GetSerializedSize());
         GameSessionUpdateInfo.Serialize(stream, instance.SessionInfo);
     }
 }
Example #14
0
 public static GameAccountList Deserialize(Stream stream, GameAccountList instance, long limit)
 {
     if (instance.Handle == null)
     {
         instance.Handle = new List <GameAccountHandle>();
     }
     while (true)
     {
         if (limit < (long)0 || stream.Position < limit)
         {
             int num = stream.ReadByte();
             if (num == -1)
             {
                 if (limit >= (long)0)
                 {
                     throw new EndOfStreamException();
                 }
                 break;
             }
             else if (num == 24)
             {
                 instance.Region = ProtocolParser.ReadUInt32(stream);
             }
             else if (num == 34)
             {
                 instance.Handle.Add(GameAccountHandle.DeserializeLengthDelimited(stream));
             }
             else
             {
                 Key key = ProtocolParser.ReadKey((byte)num, stream);
                 if (key.Field == 0)
                 {
                     throw new ProtocolBufferException("Invalid field id: 0, something went wrong in the stream");
                 }
                 ProtocolParser.SkipKey(stream, key);
             }
         }
         else
         {
             if (stream.Position != limit)
             {
                 throw new ProtocolBufferException("Read past max limit");
             }
             break;
         }
     }
     return(instance);
 }
 public static void Serialize(Stream stream, GameAccountLink instance)
 {
     if (instance.GameAccount == null)
     {
         throw new ArgumentNullException("GameAccount", "Required by proto specification.");
     }
     stream.WriteByte(10);
     ProtocolParser.WriteUInt32(stream, instance.GameAccount.GetSerializedSize());
     GameAccountHandle.Serialize(stream, instance.GameAccount);
     if (instance.Name == null)
     {
         throw new ArgumentNullException("Name", "Required by proto specification.");
     }
     stream.WriteByte(18);
     ProtocolParser.WriteBytes(stream, Encoding.get_UTF8().GetBytes(instance.Name));
 }
Example #16
0
 public static void Serialize(Stream stream, GameAccountList instance)
 {
     if (instance.HasRegion)
     {
         stream.WriteByte(24);
         ProtocolParser.WriteUInt32(stream, instance.Region);
     }
     if (instance.Handle.Count > 0)
     {
         foreach (GameAccountHandle handle in instance.Handle)
         {
             stream.WriteByte(34);
             ProtocolParser.WriteUInt32(stream, handle.GetSerializedSize());
             GameAccountHandle.Serialize(stream, handle);
         }
     }
 }
Example #17
0
        public uint GetSerializedSize()
        {
            uint num = 0u;

            if (this.Account.get_Count() > 0)
            {
                using (List <AccountId> .Enumerator enumerator = this.Account.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        AccountId current = enumerator.get_Current();
                        num += 1u;
                        uint serializedSize = current.GetSerializedSize();
                        num += serializedSize + ProtocolParser.SizeOfUInt32(serializedSize);
                    }
                }
            }
            if (this.GameAccount.get_Count() > 0)
            {
                using (List <GameAccountHandle> .Enumerator enumerator2 = this.GameAccount.GetEnumerator())
                {
                    while (enumerator2.MoveNext())
                    {
                        GameAccountHandle current2 = enumerator2.get_Current();
                        num += 1u;
                        uint serializedSize2 = current2.GetSerializedSize();
                        num += serializedSize2 + ProtocolParser.SizeOfUInt32(serializedSize2);
                    }
                }
            }
            if (this.Email.get_Count() > 0)
            {
                using (List <string> .Enumerator enumerator3 = this.Email.GetEnumerator())
                {
                    while (enumerator3.MoveNext())
                    {
                        string current3 = enumerator3.get_Current();
                        num += 1u;
                        uint byteCount = (uint)Encoding.get_UTF8().GetByteCount(current3);
                        num += ProtocolParser.SizeOfUInt32(byteCount) + byteCount;
                    }
                }
            }
            return(num);
        }
        public override int GetHashCode()
        {
            int num = base.GetType().GetHashCode();

            if (this.HasRegion)
            {
                num ^= this.Region.GetHashCode();
            }
            using (List <GameAccountHandle> .Enumerator enumerator = this.Handle.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    GameAccountHandle current = enumerator.get_Current();
                    num ^= current.GetHashCode();
                }
            }
            return(num);
        }
Example #19
0
 public static void Serialize(Stream stream, CacheExpireRequest instance)
 {
     if (instance.Account.get_Count() > 0)
     {
         using (List <AccountId> .Enumerator enumerator = instance.Account.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 AccountId current = enumerator.get_Current();
                 stream.WriteByte(10);
                 ProtocolParser.WriteUInt32(stream, current.GetSerializedSize());
                 AccountId.Serialize(stream, current);
             }
         }
     }
     if (instance.GameAccount.get_Count() > 0)
     {
         using (List <GameAccountHandle> .Enumerator enumerator2 = instance.GameAccount.GetEnumerator())
         {
             while (enumerator2.MoveNext())
             {
                 GameAccountHandle current2 = enumerator2.get_Current();
                 stream.WriteByte(18);
                 ProtocolParser.WriteUInt32(stream, current2.GetSerializedSize());
                 GameAccountHandle.Serialize(stream, current2);
             }
         }
     }
     if (instance.Email.get_Count() > 0)
     {
         using (List <string> .Enumerator enumerator3 = instance.Email.GetEnumerator())
         {
             while (enumerator3.MoveNext())
             {
                 string current3 = enumerator3.get_Current();
                 stream.WriteByte(26);
                 ProtocolParser.WriteBytes(stream, Encoding.get_UTF8().GetBytes(current3));
             }
         }
     }
 }
 public static void Serialize(Stream stream, GameAccountList instance)
 {
     if (instance.HasRegion)
     {
         stream.WriteByte(24);
         ProtocolParser.WriteUInt32(stream, instance.Region);
     }
     if (instance.Handle.get_Count() > 0)
     {
         using (List <GameAccountHandle> .Enumerator enumerator = instance.Handle.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 GameAccountHandle current = enumerator.get_Current();
                 stream.WriteByte(34);
                 ProtocolParser.WriteUInt32(stream, current.GetSerializedSize());
                 GameAccountHandle.Serialize(stream, current);
             }
         }
     }
 }
Example #21
0
        public override bool Equals(object obj)
        {
            GameAccountHandle gameAccountHandle = obj as GameAccountHandle;

            if (gameAccountHandle == null)
            {
                return(false);
            }
            if (!this.Id.Equals(gameAccountHandle.Id))
            {
                return(false);
            }
            if (!this.Program.Equals(gameAccountHandle.Program))
            {
                return(false);
            }
            if (!this.Region.Equals(gameAccountHandle.Region))
            {
                return(false);
            }
            return(true);
        }
        public uint GetSerializedSize()
        {
            uint num = 0u;

            if (this.HasRegion)
            {
                num += 1u;
                num += ProtocolParser.SizeOfUInt32(this.Region);
            }
            if (this.Handle.get_Count() > 0)
            {
                using (List <GameAccountHandle> .Enumerator enumerator = this.Handle.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        GameAccountHandle current = enumerator.get_Current();
                        num += 1u;
                        uint serializedSize = current.GetSerializedSize();
                        num += serializedSize + ProtocolParser.SizeOfUInt32(serializedSize);
                    }
                }
            }
            return(num);
        }
 public static GameAccountHandle Deserialize(Stream stream, GameAccountHandle instance)
 {
     return(GameAccountHandle.Deserialize(stream, instance, -1L));
 }
 public void Deserialize(Stream stream)
 {
     GameAccountHandle.Deserialize(stream, this);
 }
        public override bool Equals(object obj)
        {
            GameAccountHandle gameAccountHandle = obj as GameAccountHandle;

            return(gameAccountHandle != null && this.Id.Equals(gameAccountHandle.Id) && this.Program.Equals(gameAccountHandle.Program) && this.Region.Equals(gameAccountHandle.Region));
        }
 public static GameAccountBlob Deserialize(Stream stream, GameAccountBlob instance, long limit)
 {
     instance.Name             = string.Empty;
     instance.RealmPermissions = 0u;
     instance.Flags            = 0UL;
     instance.BillingFlags     = 0u;
     if (instance.Licenses == null)
     {
         instance.Licenses = new List <AccountLicense>();
     }
     while (limit < 0L || stream.Position < limit)
     {
         int num = stream.ReadByte();
         if (num == -1)
         {
             if (limit >= 0L)
             {
                 throw new EndOfStreamException();
             }
             return(instance);
         }
         else if (num != 10)
         {
             if (num != 18)
             {
                 if (num != 24)
                 {
                     if (num != 32)
                     {
                         if (num != 40)
                         {
                             if (num != 48)
                             {
                                 if (num != 56)
                                 {
                                     if (num != 80)
                                     {
                                         if (num != 88)
                                         {
                                             if (num != 96)
                                             {
                                                 if (num != 104)
                                                 {
                                                     if (num != 112)
                                                     {
                                                         Key  key   = ProtocolParser.ReadKey((byte)num, stream);
                                                         uint field = key.Field;
                                                         if (field == 0u)
                                                         {
                                                             throw new ProtocolBufferException("Invalid field id: 0, something went wrong in the stream");
                                                         }
                                                         if (field != 20u)
                                                         {
                                                             ProtocolParser.SkipKey(stream, key);
                                                         }
                                                         else if (key.WireType == Wire.LengthDelimited)
                                                         {
                                                             instance.Licenses.Add(AccountLicense.DeserializeLengthDelimited(stream));
                                                         }
                                                     }
                                                     else
                                                     {
                                                         instance.BoxLevelExpiration = ProtocolParser.ReadUInt64(stream);
                                                     }
                                                 }
                                                 else
                                                 {
                                                     instance.BoxLevel = ProtocolParser.ReadUInt32(stream);
                                                 }
                                             }
                                             else
                                             {
                                                 instance.StatusExpiration = ProtocolParser.ReadUInt64(stream);
                                             }
                                         }
                                         else
                                         {
                                             instance.UnitsRemaining = ProtocolParser.ReadUInt32(stream);
                                         }
                                     }
                                     else
                                     {
                                         instance.SubscriptionExpiration = ProtocolParser.ReadUInt64(stream);
                                     }
                                 }
                                 else
                                 {
                                     instance.CacheExpiration = ProtocolParser.ReadUInt64(stream);
                                 }
                             }
                             else
                             {
                                 instance.BillingFlags = ProtocolParser.ReadUInt32(stream);
                             }
                         }
                         else
                         {
                             instance.Flags = ProtocolParser.ReadUInt64(stream);
                         }
                     }
                     else
                     {
                         instance.Status = ProtocolParser.ReadUInt32(stream);
                     }
                 }
                 else
                 {
                     instance.RealmPermissions = ProtocolParser.ReadUInt32(stream);
                 }
             }
             else
             {
                 instance.Name = ProtocolParser.ReadString(stream);
             }
         }
         else if (instance.GameAccount == null)
         {
             instance.GameAccount = GameAccountHandle.DeserializeLengthDelimited(stream);
         }
         else
         {
             GameAccountHandle.DeserializeLengthDelimited(stream, instance.GameAccount);
         }
     }
     if (stream.Position == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
Example #27
0
 public void SetGameAccount(GameAccountHandle val)
 {
     this.GameAccount = val;
 }
 public void AddHandle(GameAccountHandle val)
 {
     this._Handle.Add(val);
 }
Example #29
0
 public void AddGameAccount(GameAccountHandle val)
 {
     this._GameAccount.Add(val);
 }
 public static void Serialize(Stream stream, GameAccountBlob instance)
 {
     if (instance.GameAccount == null)
     {
         throw new ArgumentNullException("GameAccount", "Required by proto specification.");
     }
     stream.WriteByte(10);
     ProtocolParser.WriteUInt32(stream, instance.GameAccount.GetSerializedSize());
     GameAccountHandle.Serialize(stream, instance.GameAccount);
     if (instance.HasName)
     {
         stream.WriteByte(18);
         ProtocolParser.WriteBytes(stream, Encoding.UTF8.GetBytes(instance.Name));
     }
     if (instance.HasRealmPermissions)
     {
         stream.WriteByte(24);
         ProtocolParser.WriteUInt32(stream, instance.RealmPermissions);
     }
     stream.WriteByte(32);
     ProtocolParser.WriteUInt32(stream, instance.Status);
     if (instance.HasFlags)
     {
         stream.WriteByte(40);
         ProtocolParser.WriteUInt64(stream, instance.Flags);
     }
     if (instance.HasBillingFlags)
     {
         stream.WriteByte(48);
         ProtocolParser.WriteUInt32(stream, instance.BillingFlags);
     }
     stream.WriteByte(56);
     ProtocolParser.WriteUInt64(stream, instance.CacheExpiration);
     if (instance.HasSubscriptionExpiration)
     {
         stream.WriteByte(80);
         ProtocolParser.WriteUInt64(stream, instance.SubscriptionExpiration);
     }
     if (instance.HasUnitsRemaining)
     {
         stream.WriteByte(88);
         ProtocolParser.WriteUInt32(stream, instance.UnitsRemaining);
     }
     if (instance.HasStatusExpiration)
     {
         stream.WriteByte(96);
         ProtocolParser.WriteUInt64(stream, instance.StatusExpiration);
     }
     if (instance.HasBoxLevel)
     {
         stream.WriteByte(104);
         ProtocolParser.WriteUInt32(stream, instance.BoxLevel);
     }
     if (instance.HasBoxLevelExpiration)
     {
         stream.WriteByte(112);
         ProtocolParser.WriteUInt64(stream, instance.BoxLevelExpiration);
     }
     if (instance.Licenses.Count > 0)
     {
         foreach (AccountLicense accountLicense in instance.Licenses)
         {
             stream.WriteByte(162);
             stream.WriteByte(1);
             ProtocolParser.WriteUInt32(stream, accountLicense.GetSerializedSize());
             AccountLicense.Serialize(stream, accountLicense);
         }
     }
 }