public static ProgramTag DeserializeLengthDelimited(Stream stream) { ProgramTag programTag = new ProgramTag(); ProgramTag.DeserializeLengthDelimited(stream, programTag); return(programTag); }
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); }
public static ProgramTag DeserializeLengthDelimited(Stream stream, ProgramTag instance) { long num = (long)((ulong)ProtocolParser.ReadUInt32(stream)); num += stream.get_Position(); return(ProgramTag.Deserialize(stream, instance, num)); }
public static ProgramTag DeserializeLengthDelimited(Stream stream, ProgramTag instance) { long position = (long)ProtocolParser.ReadUInt32(stream); position += stream.Position; return(ProgramTag.Deserialize(stream, instance, position)); }
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, ProgramTag instance) { BinaryWriter binaryWriter = new BinaryWriter(stream); if (instance.HasProgram) { stream.WriteByte(13); binaryWriter.Write(instance.Program); } if (instance.HasTag) { stream.WriteByte(21); binaryWriter.Write(instance.Tag); } }
public static ProgramTag Deserialize(Stream stream, ProgramTag 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.Program = binaryReader.ReadUInt32(); } } } if (stream.get_Position() == limit) { return(instance); } throw new ProtocolBufferException("Read past max limit"); }
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); } } }
public static ProgramTag Deserialize(Stream stream, ProgramTag 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.Program = 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); }
public override bool Equals(object obj) { ProgramTag programTag = obj as ProgramTag; if (programTag == null) { return(false); } if (this.HasProgram != programTag.HasProgram || this.HasProgram && !this.Program.Equals(programTag.Program)) { return(false); } if (this.HasTag == programTag.HasTag && (!this.HasTag || this.Tag.Equals(programTag.Tag))) { return(true); } return(false); }
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 void AddGameLevelInfoTags(ProgramTag val) { this._GameLevelInfoTags.Add(val); }
public static ProgramTag Deserialize(Stream stream, ProgramTag instance) { return(ProgramTag.Deserialize(stream, instance, -1L)); }
public void Deserialize(Stream stream) { ProgramTag.Deserialize(stream, this); }
public override bool Equals(object obj) { ProgramTag programTag = obj as ProgramTag; return(programTag != null && this.HasProgram == programTag.HasProgram && (!this.HasProgram || this.Program.Equals(programTag.Program)) && this.HasTag == programTag.HasTag && (!this.HasTag || this.Tag.Equals(programTag.Tag))); }
public void AddGameStatusTags(ProgramTag val) { this._GameStatusTags.Add(val); }
public void Serialize(Stream stream) { ProgramTag.Serialize(stream, this); }
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"); }