public static GameAccountOfflineNotification DeserializeLengthDelimited(Stream stream) { GameAccountOfflineNotification gameAccountOfflineNotification = new GameAccountOfflineNotification(); GameAccountOfflineNotification.DeserializeLengthDelimited(stream, gameAccountOfflineNotification); return(gameAccountOfflineNotification); }
public static GameAccountOfflineNotification DeserializeLengthDelimited(Stream stream, GameAccountOfflineNotification instance) { long num = (long)((ulong)ProtocolParser.ReadUInt32(stream)); num += stream.Position; return(GameAccountOfflineNotification.Deserialize(stream, instance, num)); }
public static GameAccountOfflineNotification Deserialize(Stream stream, GameAccountOfflineNotification instance, long limit) { 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 == 10) { if (instance.GameAccountId != null) { EntityId.DeserializeLengthDelimited(stream, instance.GameAccountId); } else { instance.GameAccountId = EntityId.DeserializeLengthDelimited(stream); } } else if (num != 18) { 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.Host != null) { ProcessId.DeserializeLengthDelimited(stream, instance.Host); } else { instance.Host = ProcessId.DeserializeLengthDelimited(stream); } } else { if (stream.Position != limit) { throw new ProtocolBufferException("Read past max limit"); } break; } } return(instance); }
public static GameAccountOfflineNotification Deserialize(Stream stream, GameAccountOfflineNotification instance, long limit) { 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 != 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.Host == null) { instance.Host = ProcessId.DeserializeLengthDelimited(stream); } else { ProcessId.DeserializeLengthDelimited(stream, instance.Host); } } else if (instance.GameAccountId == null) { instance.GameAccountId = EntityId.DeserializeLengthDelimited(stream); } else { EntityId.DeserializeLengthDelimited(stream, instance.GameAccountId); } } } if (stream.get_Position() == limit) { return(instance); } throw new ProtocolBufferException("Read past max limit"); }
public static void Serialize(Stream stream, GameAccountOfflineNotification instance) { if (instance.GameAccountId == null) { throw new ArgumentNullException("GameAccountId", "Required by proto specification."); } stream.WriteByte(10); ProtocolParser.WriteUInt32(stream, instance.GameAccountId.GetSerializedSize()); EntityId.Serialize(stream, instance.GameAccountId); if (instance.HasHost) { stream.WriteByte(18); ProtocolParser.WriteUInt32(stream, instance.Host.GetSerializedSize()); ProcessId.Serialize(stream, instance.Host); } }
public override bool Equals(object obj) { GameAccountOfflineNotification gameAccountOfflineNotification = obj as GameAccountOfflineNotification; if (gameAccountOfflineNotification == null) { return(false); } if (!this.GameAccountId.Equals(gameAccountOfflineNotification.GameAccountId)) { return(false); } if (this.HasHost == gameAccountOfflineNotification.HasHost && (!this.HasHost || this.Host.Equals(gameAccountOfflineNotification.Host))) { return(true); } return(false); }
public static GameAccountOfflineNotification Deserialize(Stream stream, GameAccountOfflineNotification instance) { return(GameAccountOfflineNotification.Deserialize(stream, instance, -1L)); }
public void Deserialize(Stream stream) { GameAccountOfflineNotification.Deserialize(stream, this); }
public override bool Equals(object obj) { GameAccountOfflineNotification gameAccountOfflineNotification = obj as GameAccountOfflineNotification; return(gameAccountOfflineNotification != null && this.GameAccountId.Equals(gameAccountOfflineNotification.GameAccountId) && this.HasHost == gameAccountOfflineNotification.HasHost && (!this.HasHost || this.Host.Equals(gameAccountOfflineNotification.Host))); }