sharp-chat/SharpChat.SockChat/PacketsS2C/UserUpdateNotificationS2CPacket.cs

28 lines
855 B
C#
Raw Normal View History

using System;
namespace SharpChat.SockChat.PacketsS2C {
public class UserUpdateNotificationS2CPacket : ISockChatS2CPacket {
private readonly long MessageId;
private readonly DateTimeOffset TimeStamp;
private readonly string PreviousName;
private readonly string NewName;
public UserUpdateNotificationS2CPacket(string previousName, string newName) {
MessageId = SharpId.Next();
TimeStamp = DateTimeOffset.UtcNow;
PreviousName = previousName;
NewName = newName;
}
public 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",
TimeStamp.ToUnixTimeSeconds(),
2024-05-10 17:28:52 +00:00
PreviousName,
NewName,
MessageId
2024-05-10 17:28:52 +00:00
);
}
}
}