sharp-chat/SharpChat/Packet/BroadcastPacket.cs

23 lines
581 B
C#
Raw Normal View History

using System;
namespace SharpChat.Packet {
public class BroadcastPacket : ServerPacket {
private readonly long Timestamp;
private readonly string Body;
public BroadcastPacket(string body) {
Timestamp = DateTimeOffset.Now.ToUnixTimeSeconds();
Body = body;
}
public override string Pack() {
return string.Format(
"2\t{0}\t-1\t0\fsay\f{1}\t{2}\t10010",
Timestamp,
SharpUtil.Sanitise(Body),
SequenceId
);
}
}
}