forked from PGR/ascnet
Added Ping handler, reconnection MIGHT work now
This commit is contained in:
parent
296bdd11e5
commit
2cb46f545a
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue