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

            num += stream.get_Position();
            return(GetGameStatsRequest.Deserialize(stream, instance, num));
        }
Пример #2
0
        public static GetGameStatsRequest DeserializeLengthDelimited(Stream stream, GetGameStatsRequest instance)
        {
            long position = (long)ProtocolParser.ReadUInt32(stream);

            position += stream.Position;
            return(GetGameStatsRequest.Deserialize(stream, instance, position));
        }
Пример #3
0
        public static GetGameStatsRequest DeserializeLengthDelimited(Stream stream)
        {
            GetGameStatsRequest getGameStatsRequest = new GetGameStatsRequest();

            GetGameStatsRequest.DeserializeLengthDelimited(stream, getGameStatsRequest);
            return(getGameStatsRequest);
        }
Пример #4
0
        public static GetGameStatsRequest Deserialize(Stream stream, GetGameStatsRequest instance, long limit)
        {
            BinaryReader binaryReader = new BinaryReader(stream);

            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 != 9)
                    {
                        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 if (instance.Filter == null)
                        {
                            instance.Filter = AttributeFilter.DeserializeLengthDelimited(stream);
                        }
                        else
                        {
                            AttributeFilter.DeserializeLengthDelimited(stream, instance.Filter);
                        }
                    }
                    else
                    {
                        instance.FactoryId = binaryReader.ReadUInt64();
                    }
                }
            }
            if (stream.get_Position() == limit)
            {
                return(instance);
            }
            throw new ProtocolBufferException("Read past max limit");
        }
Пример #5
0
        public static void Serialize(Stream stream, GetGameStatsRequest instance)
        {
            BinaryWriter binaryWriter = new BinaryWriter(stream);

            stream.WriteByte(9);
            binaryWriter.Write(instance.FactoryId);
            if (instance.Filter == null)
            {
                throw new ArgumentNullException("Filter", "Required by proto specification.");
            }
            stream.WriteByte(18);
            ProtocolParser.WriteUInt32(stream, instance.Filter.GetSerializedSize());
            AttributeFilter.Serialize(stream, instance.Filter);
        }
Пример #6
0
        public override bool Equals(object obj)
        {
            GetGameStatsRequest getGameStatsRequest = obj as GetGameStatsRequest;

            if (getGameStatsRequest == null)
            {
                return(false);
            }
            if (!this.FactoryId.Equals(getGameStatsRequest.FactoryId))
            {
                return(false);
            }
            if (!this.Filter.Equals(getGameStatsRequest.Filter))
            {
                return(false);
            }
            return(true);
        }
Пример #7
0
 public static GetGameStatsRequest Deserialize(Stream stream, GetGameStatsRequest instance)
 {
     return(GetGameStatsRequest.Deserialize(stream, instance, -1L));
 }
Пример #8
0
 public void Deserialize(Stream stream)
 {
     GetGameStatsRequest.Deserialize(stream, this);
 }
Пример #9
0
        public override bool Equals(object obj)
        {
            GetGameStatsRequest getGameStatsRequest = obj as GetGameStatsRequest;

            return(getGameStatsRequest != null && this.FactoryId.Equals(getGameStatsRequest.FactoryId) && this.Filter.Equals(getGameStatsRequest.Filter));
        }