sharp-chat/SharpChat/Packet/UserUpdateNotificationPacket.cs

25 lines
746 B
C#

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