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

View File

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