sharp-chat/SharpChat/Packet/UserNameInUseErrorPacket.cs

17 lines
527 B
C#

using System;
namespace SharpChat.Packet {
public class UserNameInUseErrorPacket : ServerPacket {
private readonly long Timestamp;
private readonly string UserName;
public UserNameInUseErrorPacket(string userName) {
Timestamp = DateTimeOffset.Now.ToUnixTimeSeconds();
UserName = userName;
}
public override string Pack() {
return string.Format("2\t{0}\t-1\t1\fnameinuse\f{1}\t{2}\t10010", Timestamp, UserName, SequenceId);
}
}
}