20 lines
514 B
C#
20 lines
514 B
C#
using System;
|
|
|
|
namespace SharpChat.Packet {
|
|
public class ForceDisconnectPacket : ServerPacket {
|
|
private readonly long Expires;
|
|
|
|
public ForceDisconnectPacket() {}
|
|
|
|
public ForceDisconnectPacket(DateTimeOffset expires) {
|
|
Expires = expires.Year >= 2100 ? -1 : expires.ToUnixTimeSeconds();
|
|
}
|
|
|
|
public override string Pack() {
|
|
if(Expires != 0)
|
|
return string.Format("9\t1\t{0}", Expires);
|
|
|
|
return "9\t0";
|
|
}
|
|
}
|
|
}
|