public static SubscriberReference DeserializeLengthDelimited(Stream stream, SubscriberReference instance) { long num = (long)((ulong)ProtocolParser.ReadUInt32(stream)); num += stream.Position; return(SubscriberReference.Deserialize(stream, instance, num)); }
public static SubscriberReference DeserializeLengthDelimited(Stream stream) { SubscriberReference subscriberReference = new SubscriberReference(); SubscriberReference.DeserializeLengthDelimited(stream, subscriberReference); return(subscriberReference); }
public override bool Equals(object obj) { SubscriberReference subscriberReference = obj as SubscriberReference; if (subscriberReference == null) { return(false); } if (this.HasObjectId != subscriberReference.HasObjectId || this.HasObjectId && !this.ObjectId.Equals(subscriberReference.ObjectId)) { return(false); } if (this.HasEntityId != subscriberReference.HasEntityId || this.HasEntityId && !this.EntityId.Equals(subscriberReference.EntityId)) { return(false); } if (this.HasAccountOptions != subscriberReference.HasAccountOptions || this.HasAccountOptions && !this.AccountOptions.Equals(subscriberReference.AccountOptions)) { return(false); } if (this.HasAccountTags != subscriberReference.HasAccountTags || this.HasAccountTags && !this.AccountTags.Equals(subscriberReference.AccountTags)) { return(false); } if (this.HasGameAccountOptions != subscriberReference.HasGameAccountOptions || this.HasGameAccountOptions && !this.GameAccountOptions.Equals(subscriberReference.GameAccountOptions)) { return(false); } if (this.HasGameAccountTags == subscriberReference.HasGameAccountTags && (!this.HasGameAccountTags || this.GameAccountTags.Equals(subscriberReference.GameAccountTags))) { return(true); } return(false); }
public static void Serialize(Stream stream, SubscriptionUpdateRequest instance) { if (instance.Ref.Count > 0) { foreach (SubscriberReference @ref in instance.Ref) { stream.WriteByte(18); ProtocolParser.WriteUInt32(stream, @ref.GetSerializedSize()); SubscriberReference.Serialize(stream, @ref); } } }
public override int GetHashCode() { int num = base.GetType().GetHashCode(); using (List <SubscriberReference> .Enumerator enumerator = this.Ref.GetEnumerator()) { while (enumerator.MoveNext()) { SubscriberReference current = enumerator.get_Current(); num ^= current.GetHashCode(); } } return(num); }
public static void Serialize(Stream stream, SubscriptionUpdateRequest instance) { if (instance.Ref.get_Count() > 0) { using (List <SubscriberReference> .Enumerator enumerator = instance.Ref.GetEnumerator()) { while (enumerator.MoveNext()) { SubscriberReference current = enumerator.get_Current(); stream.WriteByte(18); ProtocolParser.WriteUInt32(stream, current.GetSerializedSize()); SubscriberReference.Serialize(stream, current); } } } }
public static SubscriptionUpdateRequest Deserialize(Stream stream, SubscriptionUpdateRequest instance, long limit) { if (instance.Ref == null) { instance.Ref = new List <SubscriberReference>(); } 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 == 18) { instance.Ref.Add(SubscriberReference.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); }
public uint GetSerializedSize() { uint num = 0u; if (this.Ref.get_Count() > 0) { using (List <SubscriberReference> .Enumerator enumerator = this.Ref.GetEnumerator()) { while (enumerator.MoveNext()) { SubscriberReference current = enumerator.get_Current(); num += 1u; uint serializedSize = current.GetSerializedSize(); num += serializedSize + ProtocolParser.SizeOfUInt32(serializedSize); } } } return(num); }
public static SubscriptionUpdateRequest Deserialize(Stream stream, SubscriptionUpdateRequest instance, long limit) { if (instance.Ref == null) { instance.Ref = new List <SubscriberReference>(); } 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 != 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.Ref.Add(SubscriberReference.DeserializeLengthDelimited(stream)); } } } if (stream.get_Position() == limit) { return(instance); } throw new ProtocolBufferException("Read past max limit"); }
public static void Serialize(Stream stream, SubscriberReference instance) { if (instance.HasObjectId) { stream.WriteByte(8); ProtocolParser.WriteUInt64(stream, instance.ObjectId); } if (instance.HasEntityId) { stream.WriteByte(18); ProtocolParser.WriteUInt32(stream, instance.EntityId.GetSerializedSize()); EntityId.Serialize(stream, instance.EntityId); } if (instance.HasAccountOptions) { stream.WriteByte(26); ProtocolParser.WriteUInt32(stream, instance.AccountOptions.GetSerializedSize()); AccountFieldOptions.Serialize(stream, instance.AccountOptions); } if (instance.HasAccountTags) { stream.WriteByte(34); ProtocolParser.WriteUInt32(stream, instance.AccountTags.GetSerializedSize()); AccountFieldTags.Serialize(stream, instance.AccountTags); } if (instance.HasGameAccountOptions) { stream.WriteByte(42); ProtocolParser.WriteUInt32(stream, instance.GameAccountOptions.GetSerializedSize()); GameAccountFieldOptions.Serialize(stream, instance.GameAccountOptions); } if (instance.HasGameAccountTags) { stream.WriteByte(50); ProtocolParser.WriteUInt32(stream, instance.GameAccountTags.GetSerializedSize()); GameAccountFieldTags.Serialize(stream, instance.GameAccountTags); } }
public void AddRef(SubscriberReference val) { this._Ref.Add(val); }
public void Serialize(Stream stream) { SubscriberReference.Serialize(stream, this); }
public static SubscriberReference Deserialize(Stream stream, SubscriberReference instance, long limit) { instance.ObjectId = 0UL; while (limit < 0L || stream.Position < limit) { int num = stream.ReadByte(); if (num == -1) { if (limit >= 0L) { throw new EndOfStreamException(); } return(instance); } else if (num != 8) { if (num != 18) { if (num != 26) { if (num != 34) { if (num != 42) { if (num != 50) { 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.GameAccountTags == null) { instance.GameAccountTags = GameAccountFieldTags.DeserializeLengthDelimited(stream); } else { GameAccountFieldTags.DeserializeLengthDelimited(stream, instance.GameAccountTags); } } else if (instance.GameAccountOptions == null) { instance.GameAccountOptions = GameAccountFieldOptions.DeserializeLengthDelimited(stream); } else { GameAccountFieldOptions.DeserializeLengthDelimited(stream, instance.GameAccountOptions); } } else if (instance.AccountTags == null) { instance.AccountTags = AccountFieldTags.DeserializeLengthDelimited(stream); } else { AccountFieldTags.DeserializeLengthDelimited(stream, instance.AccountTags); } } else if (instance.AccountOptions == null) { instance.AccountOptions = AccountFieldOptions.DeserializeLengthDelimited(stream); } else { AccountFieldOptions.DeserializeLengthDelimited(stream, instance.AccountOptions); } } else if (instance.EntityId == null) { instance.EntityId = EntityId.DeserializeLengthDelimited(stream); } else { EntityId.DeserializeLengthDelimited(stream, instance.EntityId); } } else { instance.ObjectId = ProtocolParser.ReadUInt64(stream); } } if (stream.Position == limit) { return(instance); } throw new ProtocolBufferException("Read past max limit"); }
public static SubscriberReference Deserialize(Stream stream, SubscriberReference instance) { return(SubscriberReference.Deserialize(stream, instance, -1L)); }
public override bool Equals(object obj) { SubscriberReference subscriberReference = obj as SubscriberReference; return(subscriberReference != null && this.HasObjectId == subscriberReference.HasObjectId && (!this.HasObjectId || this.ObjectId.Equals(subscriberReference.ObjectId)) && this.HasEntityId == subscriberReference.HasEntityId && (!this.HasEntityId || this.EntityId.Equals(subscriberReference.EntityId)) && this.HasAccountOptions == subscriberReference.HasAccountOptions && (!this.HasAccountOptions || this.AccountOptions.Equals(subscriberReference.AccountOptions)) && this.HasAccountTags == subscriberReference.HasAccountTags && (!this.HasAccountTags || this.AccountTags.Equals(subscriberReference.AccountTags)) && this.HasGameAccountOptions == subscriberReference.HasGameAccountOptions && (!this.HasGameAccountOptions || this.GameAccountOptions.Equals(subscriberReference.GameAccountOptions)) && this.HasGameAccountTags == subscriberReference.HasGameAccountTags && (!this.HasGameAccountTags || this.GameAccountTags.Equals(subscriberReference.GameAccountTags))); }
public static SubscriberReference Deserialize(Stream stream, SubscriberReference instance, long limit) { instance.ObjectId = (ulong)0; 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 == 8) { instance.ObjectId = ProtocolParser.ReadUInt64(stream); } else if (num == 18) { if (instance.EntityId != null) { bnet.protocol.EntityId.DeserializeLengthDelimited(stream, instance.EntityId); } else { instance.EntityId = bnet.protocol.EntityId.DeserializeLengthDelimited(stream); } } else if (num == 26) { if (instance.AccountOptions != null) { AccountFieldOptions.DeserializeLengthDelimited(stream, instance.AccountOptions); } else { instance.AccountOptions = AccountFieldOptions.DeserializeLengthDelimited(stream); } } else if (num == 34) { if (instance.AccountTags != null) { AccountFieldTags.DeserializeLengthDelimited(stream, instance.AccountTags); } else { instance.AccountTags = AccountFieldTags.DeserializeLengthDelimited(stream); } } else if (num == 42) { if (instance.GameAccountOptions != null) { GameAccountFieldOptions.DeserializeLengthDelimited(stream, instance.GameAccountOptions); } else { instance.GameAccountOptions = GameAccountFieldOptions.DeserializeLengthDelimited(stream); } } else if (num != 50) { 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 (instance.GameAccountTags != null) { GameAccountFieldTags.DeserializeLengthDelimited(stream, instance.GameAccountTags); } else { instance.GameAccountTags = GameAccountFieldTags.DeserializeLengthDelimited(stream); } } else { if (stream.Position != limit) { throw new ProtocolBufferException("Read past max limit"); } break; } } return(instance); }