using System; namespace SharpChat.Packet { public class UserUpdateNotificationPacket : ServerPacket { public string PreviousName { get; private set; } public string NewName { get; private set; } public DateTimeOffset Timestamp { get; } public UserUpdateNotificationPacket(string previousName, string newName) { PreviousName = previousName ?? throw new ArgumentNullException(nameof(previousName)); NewName = newName ?? throw new ArgumentNullException(nameof(newName)); Timestamp = DateTimeOffset.Now; } public override string Pack() { return string.Format( "2\t{0}\t-1\t0\fnick\f{1}\f{2}\t{3}\t10010", Timestamp.ToUnixTimeSeconds(), PreviousName, NewName, SequenceId ); } } }