public static AccountServiceRegion DeserializeLengthDelimited(Stream stream, AccountServiceRegion instance)
        {
            long position = (long)ProtocolParser.ReadUInt32(stream);

            position += stream.Position;
            return(AccountServiceRegion.Deserialize(stream, instance, position));
        }
Example #2
0
        public static AccountServiceRegion DeserializeLengthDelimited(Stream stream)
        {
            AccountServiceRegion accountServiceRegion = new AccountServiceRegion();

            AccountServiceRegion.DeserializeLengthDelimited(stream, accountServiceRegion);
            return(accountServiceRegion);
        }
Example #3
0
        public static AccountServiceRegion DeserializeLengthDelimited(Stream stream, AccountServiceRegion instance)
        {
            long num = (long)((ulong)ProtocolParser.ReadUInt32(stream));

            num += stream.get_Position();
            return(AccountServiceRegion.Deserialize(stream, instance, num));
        }
Example #4
0
 public static void Serialize(Stream stream, AccountServiceRegion instance)
 {
     stream.WriteByte(8);
     ProtocolParser.WriteUInt32(stream, instance.Id);
     if (instance.Shard == null)
     {
         throw new ArgumentNullException("Shard", "Required by proto specification.");
     }
     stream.WriteByte(18);
     ProtocolParser.WriteBytes(stream, Encoding.get_UTF8().GetBytes(instance.Shard));
 }
Example #5
0
 public static void Serialize(Stream stream, AccountServiceConfig instance)
 {
     if (instance.Region.Count > 0)
     {
         foreach (AccountServiceRegion accountServiceRegion in instance.Region)
         {
             stream.WriteByte(10);
             ProtocolParser.WriteUInt32(stream, accountServiceRegion.GetSerializedSize());
             AccountServiceRegion.Serialize(stream, accountServiceRegion);
         }
     }
 }
Example #6
0
        public override int GetHashCode()
        {
            int num = base.GetType().GetHashCode();

            using (List <AccountServiceRegion> .Enumerator enumerator = this.Region.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    AccountServiceRegion current = enumerator.get_Current();
                    num ^= current.GetHashCode();
                }
            }
            return(num);
        }
Example #7
0
 public static void Serialize(Stream stream, AccountServiceConfig instance)
 {
     if (instance.Region.get_Count() > 0)
     {
         using (List <AccountServiceRegion> .Enumerator enumerator = instance.Region.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 AccountServiceRegion current = enumerator.get_Current();
                 stream.WriteByte(10);
                 ProtocolParser.WriteUInt32(stream, current.GetSerializedSize());
                 AccountServiceRegion.Serialize(stream, current);
             }
         }
     }
 }
Example #8
0
 public static AccountServiceRegion Deserialize(Stream stream, AccountServiceRegion 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 != 8)
             {
                 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
                 {
                     instance.Shard = ProtocolParser.ReadString(stream);
                 }
             }
             else
             {
                 instance.Id = ProtocolParser.ReadUInt32(stream);
             }
         }
     }
     if (stream.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
        public override bool Equals(object obj)
        {
            AccountServiceRegion accountServiceRegion = obj as AccountServiceRegion;

            if (accountServiceRegion == null)
            {
                return(false);
            }
            if (!this.Id.Equals(accountServiceRegion.Id))
            {
                return(false);
            }
            if (!this.Shard.Equals(accountServiceRegion.Shard))
            {
                return(false);
            }
            return(true);
        }
 public static AccountServiceConfig Deserialize(Stream stream, AccountServiceConfig instance, long limit)
 {
     if (instance.Region == null)
     {
         instance.Region = new List <AccountServiceRegion>();
     }
     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.Region.Add(AccountServiceRegion.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 AccountServiceRegion Deserialize(Stream stream, AccountServiceRegion 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 == 8)
             {
                 instance.Id = ProtocolParser.ReadUInt32(stream);
             }
             else if (num == 18)
             {
                 instance.Shard = ProtocolParser.ReadString(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);
 }
Example #12
0
        public uint GetSerializedSize()
        {
            uint num = 0u;

            if (this.Region.get_Count() > 0)
            {
                using (List <AccountServiceRegion> .Enumerator enumerator = this.Region.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        AccountServiceRegion current = enumerator.get_Current();
                        num += 1u;
                        uint serializedSize = current.GetSerializedSize();
                        num += serializedSize + ProtocolParser.SizeOfUInt32(serializedSize);
                    }
                }
            }
            return(num);
        }
Example #13
0
 public static AccountServiceConfig Deserialize(Stream stream, AccountServiceConfig instance, long limit)
 {
     if (instance.Region == null)
     {
         instance.Region = new List <AccountServiceRegion>();
     }
     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.Region.Add(AccountServiceRegion.DeserializeLengthDelimited(stream));
             }
         }
     }
     if (stream.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
Example #14
0
 public static AccountServiceRegion Deserialize(Stream stream, AccountServiceRegion instance)
 {
     return(AccountServiceRegion.Deserialize(stream, instance, -1L));
 }
Example #15
0
 public void Deserialize(Stream stream)
 {
     AccountServiceRegion.Deserialize(stream, this);
 }
Example #16
0
        public override bool Equals(object obj)
        {
            AccountServiceRegion accountServiceRegion = obj as AccountServiceRegion;

            return(accountServiceRegion != null && this.Id.Equals(accountServiceRegion.Id) && this.Shard.Equals(accountServiceRegion.Shard));
        }
Example #17
0
 public void AddRegion(AccountServiceRegion val)
 {
     this._Region.Add(val);
 }