Esempio n. 1
0
        public static AccountServiceConfig DeserializeLengthDelimited(Stream stream, AccountServiceConfig instance)
        {
            long num = (long)((ulong)ProtocolParser.ReadUInt32(stream));

            num += stream.get_Position();
            return(AccountServiceConfig.Deserialize(stream, instance, num));
        }
        public static AccountServiceConfig DeserializeLengthDelimited(Stream stream, AccountServiceConfig instance)
        {
            long position = (long)ProtocolParser.ReadUInt32(stream);

            position += stream.Position;
            return(AccountServiceConfig.Deserialize(stream, instance, position));
        }
Esempio n. 3
0
        public static AccountServiceConfig DeserializeLengthDelimited(Stream stream)
        {
            AccountServiceConfig accountServiceConfig = new AccountServiceConfig();

            AccountServiceConfig.DeserializeLengthDelimited(stream, accountServiceConfig);
            return(accountServiceConfig);
        }
Esempio n. 4
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);
         }
     }
 }
Esempio n. 5
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);
             }
         }
     }
 }
 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);
 }
Esempio n. 7
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");
 }
Esempio n. 8
0
        public override bool Equals(object obj)
        {
            AccountServiceConfig accountServiceConfig = obj as AccountServiceConfig;

            if (accountServiceConfig == null)
            {
                return(false);
            }
            if (this.Region.get_Count() != accountServiceConfig.Region.get_Count())
            {
                return(false);
            }
            for (int i = 0; i < this.Region.get_Count(); i++)
            {
                if (!this.Region.get_Item(i).Equals(accountServiceConfig.Region.get_Item(i)))
                {
                    return(false);
                }
            }
            return(true);
        }
Esempio n. 9
0
        public override bool Equals(object obj)
        {
            AccountServiceConfig accountServiceConfig = obj as AccountServiceConfig;

            if (accountServiceConfig == null)
            {
                return(false);
            }
            if (this.Region.Count != accountServiceConfig.Region.Count)
            {
                return(false);
            }
            for (int i = 0; i < this.Region.Count; i++)
            {
                if (!this.Region[i].Equals(accountServiceConfig.Region[i]))
                {
                    return(false);
                }
            }
            return(true);
        }
Esempio n. 10
0
 public static AccountServiceConfig Deserialize(Stream stream, AccountServiceConfig instance)
 {
     return(AccountServiceConfig.Deserialize(stream, instance, -1L));
 }
Esempio n. 11
0
 public void Deserialize(Stream stream)
 {
     AccountServiceConfig.Deserialize(stream, this);
 }