2024-05-13 20:55:54 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace SharpChat.Packet {
|
|
|
|
|
public class MOTDPacket : ServerPacket {
|
|
|
|
|
private readonly long Timestamp;
|
|
|
|
|
private readonly string Body;
|
|
|
|
|
|
|
|
|
|
public MOTDPacket(string body) {
|
|
|
|
|
Timestamp = DateTimeOffset.Now.ToUnixTimeSeconds();
|
|
|
|
|
Body = body;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string Pack() {
|
|
|
|
|
return string.Format(
|
|
|
|
|
"7\t1\t{0}\t-1\tChatBot\tinherit\t\t0\fsay\f{1}\twelcome\t0\t10010",
|
2024-05-19 02:17:51 +00:00
|
|
|
|
Timestamp, Utility.Sanitise(Body)
|
2024-05-13 20:55:54 +00:00
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|