Ejemplo 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));
        }
Ejemplo n.º 3
0
        public static AccountServiceConfig DeserializeLengthDelimited(Stream stream)
        {
            AccountServiceConfig accountServiceConfig = new AccountServiceConfig();

            AccountServiceConfig.DeserializeLengthDelimited(stream, accountServiceConfig);
            return(accountServiceConfig);
        }
Ejemplo 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);
         }
     }
 }
Ejemplo 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);
 }
Ejemplo 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");
 }
Ejemplo 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);
        }
Ejemplo 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);
        }
Ejemplo n.º 10
0
 public static AccountServiceConfig Deserialize(Stream stream, AccountServiceConfig instance)
 {
     return(AccountServiceConfig.Deserialize(stream, instance, -1L));
 }
Ejemplo n.º 11
0
 public void Deserialize(Stream stream)
 {
     AccountServiceConfig.Deserialize(stream, this);
 }