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