public static GameAccountNotification DeserializeLengthDelimited(Stream stream, GameAccountNotification instance) { long position = (long)ProtocolParser.ReadUInt32(stream); position += stream.Position; return(GameAccountNotification.Deserialize(stream, instance, position)); }
public override bool Equals(object obj) { GameAccountNotification gameAccountNotification = obj as GameAccountNotification; if (gameAccountNotification == null) { return(false); } if (this.RegionDelta.Count != gameAccountNotification.RegionDelta.Count) { return(false); } for (int i = 0; i < this.RegionDelta.Count; i++) { if (!this.RegionDelta[i].Equals(gameAccountNotification.RegionDelta[i])) { return(false); } } if (this.HasSubscriberId != gameAccountNotification.HasSubscriberId || this.HasSubscriberId && !this.SubscriberId.Equals(gameAccountNotification.SubscriberId)) { return(false); } if (this.HasAccountTags == gameAccountNotification.HasAccountTags && (!this.HasAccountTags || this.AccountTags.Equals(gameAccountNotification.AccountTags))) { return(true); } return(false); }
public static GameAccountNotification DeserializeLengthDelimited(Stream stream) { GameAccountNotification gameAccountNotification = new GameAccountNotification(); GameAccountNotification.DeserializeLengthDelimited(stream, gameAccountNotification); return(gameAccountNotification); }
public static GameAccountNotification DeserializeLengthDelimited(Stream stream, GameAccountNotification instance) { long num = (long)((ulong)ProtocolParser.ReadUInt32(stream)); num += stream.get_Position(); return(GameAccountNotification.Deserialize(stream, instance, num)); }
public static void Serialize(Stream stream, GameAccountNotification instance) { if (instance.RegionDelta.get_Count() > 0) { using (List <GameAccountList> .Enumerator enumerator = instance.RegionDelta.GetEnumerator()) { while (enumerator.MoveNext()) { GameAccountList current = enumerator.get_Current(); stream.WriteByte(10); ProtocolParser.WriteUInt32(stream, current.GetSerializedSize()); GameAccountList.Serialize(stream, current); } } } if (instance.HasSubscriberId) { stream.WriteByte(16); ProtocolParser.WriteUInt64(stream, instance.SubscriberId); } if (instance.HasAccountTags) { stream.WriteByte(26); ProtocolParser.WriteUInt32(stream, instance.AccountTags.GetSerializedSize()); AccountFieldTags.Serialize(stream, instance.AccountTags); } }
public static GameAccountNotification Deserialize(Stream stream, GameAccountNotification instance, long limit) { if (instance.RegionDelta == null) { instance.RegionDelta = new List <GameAccountList>(); } 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 != 16) { if (num2 != 26) { 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.AccountTags == null) { instance.AccountTags = AccountFieldTags.DeserializeLengthDelimited(stream); } else { AccountFieldTags.DeserializeLengthDelimited(stream, instance.AccountTags); } } else { instance.SubscriberId = ProtocolParser.ReadUInt64(stream); } } else { instance.RegionDelta.Add(GameAccountList.DeserializeLengthDelimited(stream)); } } } if (stream.get_Position() == limit) { return(instance); } throw new ProtocolBufferException("Read past max limit"); }
public override bool Equals(object obj) { GameAccountNotification gameAccountNotification = obj as GameAccountNotification; if (gameAccountNotification == null) { return(false); } if (this.RegionDelta.get_Count() != gameAccountNotification.RegionDelta.get_Count()) { return(false); } for (int i = 0; i < this.RegionDelta.get_Count(); i++) { if (!this.RegionDelta.get_Item(i).Equals(gameAccountNotification.RegionDelta.get_Item(i))) { return(false); } } return(this.HasSubscriberId == gameAccountNotification.HasSubscriberId && (!this.HasSubscriberId || this.SubscriberId.Equals(gameAccountNotification.SubscriberId)) && this.HasAccountTags == gameAccountNotification.HasAccountTags && (!this.HasAccountTags || this.AccountTags.Equals(gameAccountNotification.AccountTags))); }
public static void Serialize(Stream stream, GameAccountNotification instance) { if (instance.RegionDelta.Count > 0) { foreach (GameAccountList regionDeltum in instance.RegionDelta) { stream.WriteByte(10); ProtocolParser.WriteUInt32(stream, regionDeltum.GetSerializedSize()); GameAccountList.Serialize(stream, regionDeltum); } } if (instance.HasSubscriberId) { stream.WriteByte(16); ProtocolParser.WriteUInt64(stream, instance.SubscriberId); } if (instance.HasAccountTags) { stream.WriteByte(26); ProtocolParser.WriteUInt32(stream, instance.AccountTags.GetSerializedSize()); AccountFieldTags.Serialize(stream, instance.AccountTags); } }
public static GameAccountNotification Deserialize(Stream stream, GameAccountNotification instance) { return(GameAccountNotification.Deserialize(stream, instance, (long)-1)); }
public void Deserialize(Stream stream) { GameAccountNotification.Deserialize(stream, this); }