Пример #1
0
        public static GameAccountBlob DeserializeLengthDelimited(Stream stream, GameAccountBlob instance)
        {
            long num = (long)((ulong)ProtocolParser.ReadUInt32(stream));

            num += stream.Position;
            return(GameAccountBlob.Deserialize(stream, instance, num));
        }
Пример #2
0
        public static GameAccountBlob DeserializeLengthDelimited(Stream stream)
        {
            GameAccountBlob gameAccountBlob = new GameAccountBlob();

            GameAccountBlob.DeserializeLengthDelimited(stream, gameAccountBlob);
            return(gameAccountBlob);
        }
Пример #3
0
 public static void Serialize(Stream stream, GameAccountBlobList instance)
 {
     if (instance.Blob.Count > 0)
     {
         foreach (GameAccountBlob blob in instance.Blob)
         {
             stream.WriteByte(10);
             ProtocolParser.WriteUInt32(stream, blob.GetSerializedSize());
             GameAccountBlob.Serialize(stream, blob);
         }
     }
 }
Пример #4
0
        public override int GetHashCode()
        {
            int num = base.GetType().GetHashCode();

            using (List <GameAccountBlob> .Enumerator enumerator = this.Blob.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    GameAccountBlob current = enumerator.get_Current();
                    num ^= current.GetHashCode();
                }
            }
            return(num);
        }
Пример #5
0
 public static void Serialize(Stream stream, GameAccountBlobList instance)
 {
     if (instance.Blob.get_Count() > 0)
     {
         using (List <GameAccountBlob> .Enumerator enumerator = instance.Blob.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 GameAccountBlob current = enumerator.get_Current();
                 stream.WriteByte(10);
                 ProtocolParser.WriteUInt32(stream, current.GetSerializedSize());
                 GameAccountBlob.Serialize(stream, current);
             }
         }
     }
 }
Пример #6
0
 public static GameAccountBlobList Deserialize(Stream stream, GameAccountBlobList instance, long limit)
 {
     if (instance.Blob == null)
     {
         instance.Blob = new List <GameAccountBlob>();
     }
     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)
             {
                 instance.Blob.Add(GameAccountBlob.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);
 }
Пример #7
0
        public uint GetSerializedSize()
        {
            uint num = 0u;

            if (this.Blob.get_Count() > 0)
            {
                using (List <GameAccountBlob> .Enumerator enumerator = this.Blob.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        GameAccountBlob current = enumerator.get_Current();
                        num += 1u;
                        uint serializedSize = current.GetSerializedSize();
                        num += serializedSize + ProtocolParser.SizeOfUInt32(serializedSize);
                    }
                }
            }
            return(num);
        }
Пример #8
0
 public static GameAccountBlobList Deserialize(Stream stream, GameAccountBlobList instance, long limit)
 {
     if (instance.Blob == null)
     {
         instance.Blob = new List <GameAccountBlob>();
     }
     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)
             {
                 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.Blob.Add(GameAccountBlob.DeserializeLengthDelimited(stream));
             }
         }
     }
     if (stream.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
Пример #9
0
 public void AddBlob(GameAccountBlob val)
 {
     this._Blob.Add(val);
 }
Пример #10
0
 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);
         }
     }
 }
Пример #11
0
 public void Serialize(Stream stream)
 {
     GameAccountBlob.Serialize(stream, this);
 }
Пример #12
0
 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");
 }
Пример #13
0
 public static GameAccountBlob Deserialize(Stream stream, GameAccountBlob instance)
 {
     return(GameAccountBlob.Deserialize(stream, instance, -1L));
 }
Пример #14
0
        public override bool Equals(object obj)
        {
            GameAccountBlob gameAccountBlob = obj as GameAccountBlob;

            if (gameAccountBlob == null)
            {
                return(false);
            }
            if (!this.GameAccount.Equals(gameAccountBlob.GameAccount))
            {
                return(false);
            }
            if (this.HasName != gameAccountBlob.HasName || (this.HasName && !this.Name.Equals(gameAccountBlob.Name)))
            {
                return(false);
            }
            if (this.HasRealmPermissions != gameAccountBlob.HasRealmPermissions || (this.HasRealmPermissions && !this.RealmPermissions.Equals(gameAccountBlob.RealmPermissions)))
            {
                return(false);
            }
            if (!this.Status.Equals(gameAccountBlob.Status))
            {
                return(false);
            }
            if (this.HasFlags != gameAccountBlob.HasFlags || (this.HasFlags && !this.Flags.Equals(gameAccountBlob.Flags)))
            {
                return(false);
            }
            if (this.HasBillingFlags != gameAccountBlob.HasBillingFlags || (this.HasBillingFlags && !this.BillingFlags.Equals(gameAccountBlob.BillingFlags)))
            {
                return(false);
            }
            if (!this.CacheExpiration.Equals(gameAccountBlob.CacheExpiration))
            {
                return(false);
            }
            if (this.HasSubscriptionExpiration != gameAccountBlob.HasSubscriptionExpiration || (this.HasSubscriptionExpiration && !this.SubscriptionExpiration.Equals(gameAccountBlob.SubscriptionExpiration)))
            {
                return(false);
            }
            if (this.HasUnitsRemaining != gameAccountBlob.HasUnitsRemaining || (this.HasUnitsRemaining && !this.UnitsRemaining.Equals(gameAccountBlob.UnitsRemaining)))
            {
                return(false);
            }
            if (this.HasStatusExpiration != gameAccountBlob.HasStatusExpiration || (this.HasStatusExpiration && !this.StatusExpiration.Equals(gameAccountBlob.StatusExpiration)))
            {
                return(false);
            }
            if (this.HasBoxLevel != gameAccountBlob.HasBoxLevel || (this.HasBoxLevel && !this.BoxLevel.Equals(gameAccountBlob.BoxLevel)))
            {
                return(false);
            }
            if (this.HasBoxLevelExpiration != gameAccountBlob.HasBoxLevelExpiration || (this.HasBoxLevelExpiration && !this.BoxLevelExpiration.Equals(gameAccountBlob.BoxLevelExpiration)))
            {
                return(false);
            }
            if (this.Licenses.Count != gameAccountBlob.Licenses.Count)
            {
                return(false);
            }
            for (int i = 0; i < this.Licenses.Count; i++)
            {
                if (!this.Licenses[i].Equals(gameAccountBlob.Licenses[i]))
                {
                    return(false);
                }
            }
            return(true);
        }
Пример #15
0
 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.get_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.get_Count() > 0)
     {
         using (List <AccountLicense> .Enumerator enumerator = instance.Licenses.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 AccountLicense current = enumerator.get_Current();
                 stream.WriteByte(162);
                 stream.WriteByte(1);
                 ProtocolParser.WriteUInt32(stream, current.GetSerializedSize());
                 AccountLicense.Serialize(stream, current);
             }
         }
     }
 }