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

            num += stream.get_Position();
            return(GetFactoryInfoResponse.Deserialize(stream, instance, num));
        }
Esempio n. 2
0
        public override bool Equals(object obj)
        {
            GetFactoryInfoResponse getFactoryInfoResponse = obj as GetFactoryInfoResponse;

            if (getFactoryInfoResponse == null)
            {
                return(false);
            }
            if (this.Attribute.get_Count() != getFactoryInfoResponse.Attribute.get_Count())
            {
                return(false);
            }
            for (int i = 0; i < this.Attribute.get_Count(); i++)
            {
                if (!this.Attribute.get_Item(i).Equals(getFactoryInfoResponse.Attribute.get_Item(i)))
                {
                    return(false);
                }
            }
            if (this.StatsBucket.get_Count() != getFactoryInfoResponse.StatsBucket.get_Count())
            {
                return(false);
            }
            for (int j = 0; j < this.StatsBucket.get_Count(); j++)
            {
                if (!this.StatsBucket.get_Item(j).Equals(getFactoryInfoResponse.StatsBucket.get_Item(j)))
                {
                    return(false);
                }
            }
            return(true);
        }
Esempio n. 3
0
        public static GetFactoryInfoResponse DeserializeLengthDelimited(Stream stream)
        {
            GetFactoryInfoResponse getFactoryInfoResponse = new GetFactoryInfoResponse();

            GetFactoryInfoResponse.DeserializeLengthDelimited(stream, getFactoryInfoResponse);
            return(getFactoryInfoResponse);
        }
Esempio n. 4
0
 public static void Serialize(Stream stream, GetFactoryInfoResponse instance)
 {
     if (instance.Attribute.get_Count() > 0)
     {
         using (List <Attribute> .Enumerator enumerator = instance.Attribute.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 Attribute current = enumerator.get_Current();
                 stream.WriteByte(10);
                 ProtocolParser.WriteUInt32(stream, current.GetSerializedSize());
                 bnet.protocol.attribute.Attribute.Serialize(stream, current);
             }
         }
     }
     if (instance.StatsBucket.get_Count() > 0)
     {
         using (List <GameStatsBucket> .Enumerator enumerator2 = instance.StatsBucket.GetEnumerator())
         {
             while (enumerator2.MoveNext())
             {
                 GameStatsBucket current2 = enumerator2.get_Current();
                 stream.WriteByte(18);
                 ProtocolParser.WriteUInt32(stream, current2.GetSerializedSize());
                 GameStatsBucket.Serialize(stream, current2);
             }
         }
     }
 }
        public override bool Equals(object obj)
        {
            GetFactoryInfoResponse getFactoryInfoResponse = obj as GetFactoryInfoResponse;

            if (getFactoryInfoResponse == null)
            {
                return(false);
            }
            if (this.Attribute.Count != getFactoryInfoResponse.Attribute.Count)
            {
                return(false);
            }
            for (int i = 0; i < this.Attribute.Count; i++)
            {
                if (!this.Attribute[i].Equals(getFactoryInfoResponse.Attribute[i]))
                {
                    return(false);
                }
            }
            if (this.StatsBucket.Count != getFactoryInfoResponse.StatsBucket.Count)
            {
                return(false);
            }
            for (int j = 0; j < this.StatsBucket.Count; j++)
            {
                if (!this.StatsBucket[j].Equals(getFactoryInfoResponse.StatsBucket[j]))
                {
                    return(false);
                }
            }
            return(true);
        }
Esempio n. 6
0
        public static GetFactoryInfoResponse DeserializeLengthDelimited(Stream stream, GetFactoryInfoResponse instance)
        {
            long position = (long)ProtocolParser.ReadUInt32(stream);

            position += stream.Position;
            return(GetFactoryInfoResponse.Deserialize(stream, instance, position));
        }
Esempio n. 7
0
 public static GetFactoryInfoResponse Deserialize(Stream stream, GetFactoryInfoResponse instance, long limit)
 {
     if (instance.Attribute == null)
     {
         instance.Attribute = new List <Attribute>();
     }
     if (instance.StatsBucket == null)
     {
         instance.StatsBucket = new List <GameStatsBucket>();
     }
     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
                 {
                     instance.StatsBucket.Add(GameStatsBucket.DeserializeLengthDelimited(stream));
                 }
             }
             else
             {
                 instance.Attribute.Add(bnet.protocol.attribute.Attribute.DeserializeLengthDelimited(stream));
             }
         }
     }
     if (stream.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
 public static void Serialize(Stream stream, GetFactoryInfoResponse instance)
 {
     if (instance.Attribute.Count > 0)
     {
         foreach (bnet.protocol.attribute.Attribute attribute in instance.Attribute)
         {
             stream.WriteByte(10);
             ProtocolParser.WriteUInt32(stream, attribute.GetSerializedSize());
             bnet.protocol.attribute.Attribute.Serialize(stream, attribute);
         }
     }
     if (instance.StatsBucket.Count > 0)
     {
         foreach (GameStatsBucket gameStatsBucket in instance.StatsBucket)
         {
             stream.WriteByte(18);
             ProtocolParser.WriteUInt32(stream, gameStatsBucket.GetSerializedSize());
             GameStatsBucket.Serialize(stream, gameStatsBucket);
         }
     }
 }
Esempio n. 9
0
 public static GetFactoryInfoResponse Deserialize(Stream stream, GetFactoryInfoResponse instance)
 {
     return(GetFactoryInfoResponse.Deserialize(stream, instance, -1L));
 }
Esempio n. 10
0
 public void Deserialize(Stream stream)
 {
     GetFactoryInfoResponse.Deserialize(stream, this);
 }