sharp-chat/SharpChat/Packet/WhoisResponsePacket.cs

19 lines
646 B
C#

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