sharp-chat/SharpChat/Packet/UserUpdateNotificationPacket.cs

26 lines
746 B
C#
Raw Normal View History

using System;
namespace SharpChat.Packet {
public class UserUpdateNotificationPacket : ServerPacket {
private readonly string PreviousName;
private readonly string NewName;
2024-05-14 22:17:25 +00:00
private readonly long Timestamp;
public UserUpdateNotificationPacket(string previousName, string newName) {
PreviousName = previousName;
NewName = newName;
2024-05-14 22:17:25 +00:00
Timestamp = DateTimeOffset.Now.ToUnixTimeSeconds();
}
2024-05-10 15:24:43 +00:00
public override string Pack() {
2024-05-10 17:28:52 +00:00
return string.Format(
"2\t{0}\t-1\t0\fnick\f{1}\f{2}\t{3}\t10010",
2024-05-14 22:17:25 +00:00
Timestamp,
2024-05-10 17:28:52 +00:00
PreviousName,
NewName,
SequenceId
);
}
}
}