ascnet/AscNet.GameServer/Handlers/HeartbeatModule.cs

20 lines
530 B
C#

using AscNet.Common.MsgPack;
namespace AscNet.GameServer.Handlers
{
internal class HeartbeatModule
{
[RequestPacketHandler("HeartbeatRequest")]
public static void HeartbeatRequestHandler(Session session, Packet.Request packet)
{
HeartbeatResponse heartbeatResponse = new()
{
UtcServerTime = DateTimeOffset.UtcNow.ToUnixTimeSeconds()
};
session.SendResponse(heartbeatResponse, packet.Id);
}
// TODO: Pong?
}
}