28 lines
855 B
C#
28 lines
855 B
C#
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() {
|
|
return string.Format(
|
|
"2\t{0}\t-1\t0\fnick\f{1}\f{2}\t{3}\t10010",
|
|
TimeStamp.ToUnixTimeSeconds(),
|
|
PreviousName,
|
|
NewName,
|
|
MessageId
|
|
);
|
|
}
|
|
}
|
|
}
|