public static RegionTag DeserializeLengthDelimited(Stream stream)
        {
            RegionTag regionTag = new RegionTag();

            RegionTag.DeserializeLengthDelimited(stream, regionTag);
            return(regionTag);
        }
Exemplo n.º 2
0
        public static RegionTag DeserializeLengthDelimited(Stream stream, RegionTag instance)
        {
            long position = (long)ProtocolParser.ReadUInt32(stream);

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

            num += stream.get_Position();
            return(RegionTag.Deserialize(stream, instance, num));
        }
Exemplo n.º 4
0
        public uint GetSerializedSize()
        {
            uint num = 0u;

            if (this.HasAccountLevelInfoTag)
            {
                num += 1u;
                num += 4u;
            }
            if (this.HasPrivacyInfoTag)
            {
                num += 1u;
                num += 4u;
            }
            if (this.HasParentalControlInfoTag)
            {
                num += 1u;
                num += 4u;
            }
            if (this.GameLevelInfoTags.get_Count() > 0)
            {
                using (List <ProgramTag> .Enumerator enumerator = this.GameLevelInfoTags.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        ProgramTag current = enumerator.get_Current();
                        num += 1u;
                        uint serializedSize = current.GetSerializedSize();
                        num += serializedSize + ProtocolParser.SizeOfUInt32(serializedSize);
                    }
                }
            }
            if (this.GameStatusTags.get_Count() > 0)
            {
                using (List <ProgramTag> .Enumerator enumerator2 = this.GameStatusTags.GetEnumerator())
                {
                    while (enumerator2.MoveNext())
                    {
                        ProgramTag current2 = enumerator2.get_Current();
                        num += 1u;
                        uint serializedSize2 = current2.GetSerializedSize();
                        num += serializedSize2 + ProtocolParser.SizeOfUInt32(serializedSize2);
                    }
                }
            }
            if (this.GameAccountTags.get_Count() > 0)
            {
                using (List <RegionTag> .Enumerator enumerator3 = this.GameAccountTags.GetEnumerator())
                {
                    while (enumerator3.MoveNext())
                    {
                        RegionTag current3 = enumerator3.get_Current();
                        num += 1u;
                        uint serializedSize3 = current3.GetSerializedSize();
                        num += serializedSize3 + ProtocolParser.SizeOfUInt32(serializedSize3);
                    }
                }
            }
            return(num);
        }
Exemplo n.º 5
0
        public static void Serialize(Stream stream, AccountFieldTags instance)
        {
            BinaryWriter binaryWriter = new BinaryWriter(stream);

            if (instance.HasAccountLevelInfoTag)
            {
                stream.WriteByte(21);
                binaryWriter.Write(instance.AccountLevelInfoTag);
            }
            if (instance.HasPrivacyInfoTag)
            {
                stream.WriteByte(29);
                binaryWriter.Write(instance.PrivacyInfoTag);
            }
            if (instance.HasParentalControlInfoTag)
            {
                stream.WriteByte(37);
                binaryWriter.Write(instance.ParentalControlInfoTag);
            }
            if (instance.GameLevelInfoTags.get_Count() > 0)
            {
                using (List <ProgramTag> .Enumerator enumerator = instance.GameLevelInfoTags.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        ProgramTag current = enumerator.get_Current();
                        stream.WriteByte(58);
                        ProtocolParser.WriteUInt32(stream, current.GetSerializedSize());
                        ProgramTag.Serialize(stream, current);
                    }
                }
            }
            if (instance.GameStatusTags.get_Count() > 0)
            {
                using (List <ProgramTag> .Enumerator enumerator2 = instance.GameStatusTags.GetEnumerator())
                {
                    while (enumerator2.MoveNext())
                    {
                        ProgramTag current2 = enumerator2.get_Current();
                        stream.WriteByte(74);
                        ProtocolParser.WriteUInt32(stream, current2.GetSerializedSize());
                        ProgramTag.Serialize(stream, current2);
                    }
                }
            }
            if (instance.GameAccountTags.get_Count() > 0)
            {
                using (List <RegionTag> .Enumerator enumerator3 = instance.GameAccountTags.GetEnumerator())
                {
                    while (enumerator3.MoveNext())
                    {
                        RegionTag current3 = enumerator3.get_Current();
                        stream.WriteByte(90);
                        ProtocolParser.WriteUInt32(stream, current3.GetSerializedSize());
                        RegionTag.Serialize(stream, current3);
                    }
                }
            }
        }
        public static void Serialize(Stream stream, RegionTag instance)
        {
            BinaryWriter binaryWriter = new BinaryWriter(stream);

            if (instance.HasRegion)
            {
                stream.WriteByte(13);
                binaryWriter.Write(instance.Region);
            }
            if (instance.HasTag)
            {
                stream.WriteByte(21);
                binaryWriter.Write(instance.Tag);
            }
        }
        public static RegionTag Deserialize(Stream stream, RegionTag 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 != 13)
                    {
                        if (num2 != 21)
                        {
                            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.Tag = binaryReader.ReadUInt32();
                        }
                    }
                    else
                    {
                        instance.Region = binaryReader.ReadUInt32();
                    }
                }
            }
            if (stream.get_Position() == limit)
            {
                return(instance);
            }
            throw new ProtocolBufferException("Read past max limit");
        }
Exemplo n.º 8
0
        public static void Serialize(Stream stream, AccountFieldTags instance)
        {
            BinaryWriter binaryWriter = new BinaryWriter(stream);

            if (instance.HasAccountLevelInfoTag)
            {
                stream.WriteByte(21);
                binaryWriter.Write(instance.AccountLevelInfoTag);
            }
            if (instance.HasPrivacyInfoTag)
            {
                stream.WriteByte(29);
                binaryWriter.Write(instance.PrivacyInfoTag);
            }
            if (instance.HasParentalControlInfoTag)
            {
                stream.WriteByte(37);
                binaryWriter.Write(instance.ParentalControlInfoTag);
            }
            if (instance.GameLevelInfoTags.Count > 0)
            {
                foreach (ProgramTag programTag in instance.GameLevelInfoTags)
                {
                    stream.WriteByte(58);
                    ProtocolParser.WriteUInt32(stream, programTag.GetSerializedSize());
                    ProgramTag.Serialize(stream, programTag);
                }
            }
            if (instance.GameStatusTags.Count > 0)
            {
                foreach (ProgramTag programTag2 in instance.GameStatusTags)
                {
                    stream.WriteByte(74);
                    ProtocolParser.WriteUInt32(stream, programTag2.GetSerializedSize());
                    ProgramTag.Serialize(stream, programTag2);
                }
            }
            if (instance.GameAccountTags.Count > 0)
            {
                foreach (RegionTag regionTag in instance.GameAccountTags)
                {
                    stream.WriteByte(90);
                    ProtocolParser.WriteUInt32(stream, regionTag.GetSerializedSize());
                    RegionTag.Serialize(stream, regionTag);
                }
            }
        }
Exemplo n.º 9
0
        public static RegionTag Deserialize(Stream stream, RegionTag instance, long limit)
        {
            BinaryReader binaryReader = new BinaryReader(stream);

            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 == 13)
                    {
                        instance.Region = binaryReader.ReadUInt32();
                    }
                    else if (num == 21)
                    {
                        instance.Tag = binaryReader.ReadUInt32();
                    }
                    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);
        }
Exemplo n.º 10
0
        public override bool Equals(object obj)
        {
            RegionTag regionTag = obj as RegionTag;

            if (regionTag == null)
            {
                return(false);
            }
            if (this.HasRegion != regionTag.HasRegion || this.HasRegion && !this.Region.Equals(regionTag.Region))
            {
                return(false);
            }
            if (this.HasTag == regionTag.HasTag && (!this.HasTag || this.Tag.Equals(regionTag.Tag)))
            {
                return(true);
            }
            return(false);
        }
Exemplo n.º 11
0
        public override int GetHashCode()
        {
            int num = base.GetType().GetHashCode();

            if (this.HasAccountLevelInfoTag)
            {
                num ^= this.AccountLevelInfoTag.GetHashCode();
            }
            if (this.HasPrivacyInfoTag)
            {
                num ^= this.PrivacyInfoTag.GetHashCode();
            }
            if (this.HasParentalControlInfoTag)
            {
                num ^= this.ParentalControlInfoTag.GetHashCode();
            }
            using (List <ProgramTag> .Enumerator enumerator = this.GameLevelInfoTags.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    ProgramTag current = enumerator.get_Current();
                    num ^= current.GetHashCode();
                }
            }
            using (List <ProgramTag> .Enumerator enumerator2 = this.GameStatusTags.GetEnumerator())
            {
                while (enumerator2.MoveNext())
                {
                    ProgramTag current2 = enumerator2.get_Current();
                    num ^= current2.GetHashCode();
                }
            }
            using (List <RegionTag> .Enumerator enumerator3 = this.GameAccountTags.GetEnumerator())
            {
                while (enumerator3.MoveNext())
                {
                    RegionTag current3 = enumerator3.get_Current();
                    num ^= current3.GetHashCode();
                }
            }
            return(num);
        }
 public static RegionTag Deserialize(Stream stream, RegionTag instance)
 {
     return(RegionTag.Deserialize(stream, instance, -1L));
 }
 public void Deserialize(Stream stream)
 {
     RegionTag.Deserialize(stream, this);
 }
        public override bool Equals(object obj)
        {
            RegionTag regionTag = obj as RegionTag;

            return(regionTag != null && this.HasRegion == regionTag.HasRegion && (!this.HasRegion || this.Region.Equals(regionTag.Region)) && this.HasTag == regionTag.HasTag && (!this.HasTag || this.Tag.Equals(regionTag.Tag)));
        }
 public void Serialize(Stream stream)
 {
     RegionTag.Serialize(stream, this);
 }
Exemplo n.º 16
0
 public void AddGameAccountTags(RegionTag val)
 {
     this._GameAccountTags.Add(val);
 }
Exemplo n.º 17
0
        public static AccountFieldTags Deserialize(Stream stream, AccountFieldTags instance, long limit)
        {
            BinaryReader binaryReader = new BinaryReader(stream);

            if (instance.GameLevelInfoTags == null)
            {
                instance.GameLevelInfoTags = new List <ProgramTag>();
            }
            if (instance.GameStatusTags == null)
            {
                instance.GameStatusTags = new List <ProgramTag>();
            }
            if (instance.GameAccountTags == null)
            {
                instance.GameAccountTags = new List <RegionTag>();
            }
            while (limit < 0L || stream.Position < limit)
            {
                int num = stream.ReadByte();
                if (num == -1)
                {
                    if (limit >= 0L)
                    {
                        throw new EndOfStreamException();
                    }
                    return(instance);
                }
                else if (num != 21)
                {
                    if (num != 29)
                    {
                        if (num != 37)
                        {
                            if (num != 58)
                            {
                                if (num != 74)
                                {
                                    if (num != 90)
                                    {
                                        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.GameAccountTags.Add(RegionTag.DeserializeLengthDelimited(stream));
                                    }
                                }
                                else
                                {
                                    instance.GameStatusTags.Add(ProgramTag.DeserializeLengthDelimited(stream));
                                }
                            }
                            else
                            {
                                instance.GameLevelInfoTags.Add(ProgramTag.DeserializeLengthDelimited(stream));
                            }
                        }
                        else
                        {
                            instance.ParentalControlInfoTag = binaryReader.ReadUInt32();
                        }
                    }
                    else
                    {
                        instance.PrivacyInfoTag = binaryReader.ReadUInt32();
                    }
                }
                else
                {
                    instance.AccountLevelInfoTag = binaryReader.ReadUInt32();
                }
            }
            if (stream.Position == limit)
            {
                return(instance);
            }
            throw new ProtocolBufferException("Read past max limit");
        }