2024-05-20 02:27:41 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace SharpChat.Packet {
|
2024-05-20 02:16:38 +00:00
|
|
|
|
public class MOTDPacket : SockChatTimedS2CPacket {
|
2024-05-13 20:55:54 +00:00
|
|
|
|
private readonly string Body;
|
|
|
|
|
|
2024-05-20 02:27:41 +00:00
|
|
|
|
public MOTDPacket(DateTimeOffset timeStamp, string body) : base(timeStamp) {
|
2024-05-13 20:55:54 +00:00
|
|
|
|
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-20 02:16:38 +00:00
|
|
|
|
TimeStamp.ToUnixTimeSeconds(),
|
|
|
|
|
SockChatUtility.SanitiseMessageBody(Body)
|
2024-05-13 20:55:54 +00:00
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|