forked from PGR/ascnet
1
0
Fork 0

player instance on session

This commit is contained in:
rfi 2023-10-16 16:53:53 +07:00
parent 5af2ab34d0
commit 8ebfb0df9a
2 changed files with 4 additions and 0 deletions

View File

@ -38,6 +38,7 @@ namespace AscNet.GameServer.Handlers
return;
}
session.player = player;
session.SendResponse(new LoginResponse
{
Code = 0,
@ -64,6 +65,7 @@ namespace AscNet.GameServer.Handlers
return;
}
session.player = player;
session.SendResponse(new ReconnectResponse()
{
ReconnectToken = request.Token

View File

@ -1,6 +1,7 @@
using System.Buffers.Binary;
using System.Net.Sockets;
using AscNet.Common;
using AscNet.Common.Database;
using AscNet.Common.Util;
using AscNet.Logging;
using MessagePack;
@ -13,6 +14,7 @@ namespace AscNet.GameServer
{
public readonly string id;
public readonly TcpClient client;
public Player player = default!;
public readonly Logger log;
private long lastPacketTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
private ushort packetNo = 0;