forked from PGR/ascnet
1
0
Fork 0

Added Ping handler, reconnection MIGHT work now

This commit is contained in:
Kyle Belanger 2023-10-14 14:01:21 -04:00
parent 296bdd11e5
commit 2cb46f545a
2 changed files with 27 additions and 1 deletions

View File

@ -36,6 +36,25 @@ namespace AscNet.GameServer.Handlers
DoLogin(session);
}
[RequestPacketHandler("ReconnectRequest")]
public static void ReconnectRequestHandler(Session session, Packet.Request packet)
{
session.SendResponse(new ReconnectResponse()
{
Code = 0,
OfflineMessages = { },
ReconnectToken = "eeeeeeeeeeeeeeh",
RequestNo = 0
}, packet.Id);
}
/* TODO
[RequestPacketHandler("ReconnectAck")]
public static void ReconnectAckHandler(Session session, Packet.Request packet)
{
}
*/
// TODO: Move somewhere else, also split.
static void DoLogin(Session session)
{

View File

@ -14,6 +14,13 @@ namespace AscNet.GameServer.Handlers
session.SendResponse(heartbeatResponse, packet.Id);
}
// TODO: Pong?
[RequestPacketHandler("Ping")]
public static void PingHandler(Session session, Packet.Request packet)
{
session.SendResponse(new Pong()
{
UtcTime = (ulong)DateTimeOffset.UtcNow.UtcTicks
}, packet.Id);
}
}
}