Avoid directly utilizing the disconnect method for GameClient.

This commit is contained in:
MobiusDevelopment
2023-07-27 03:58:32 +03:00
parent 47b9dbd20f
commit c449a89a83
64 changed files with 95 additions and 62 deletions

View File

@ -97,11 +97,12 @@ public class GameClient extends NetClient
Disconnection.of(this).onDisconnection();
}
_connectionState = ConnectionState.DISCONNECTED;
super.onDisconnection();
}
public void closeNow()
{
disconnect();
onDisconnection();
}
public void close(ServerPacket packet)

View File

@ -43,7 +43,7 @@ public class PacketHandler implements PacketHandlerInterface<GameClient>
{
LOGGER.warning("PacketHandler: Problem receiving packet id from " + client);
LOGGER.warning(CommonUtil.getStackTrace(e));
client.disconnect();
client.closeNow();
return;
}