mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-02 14:38:26 +01:00
Remove player on server shutdown
This commit is contained in:
parent
72bda2c4ec
commit
874c60fb6a
@ -349,11 +349,14 @@ public final class ConnectionManager {
|
||||
if (playerConnection instanceof PlayerSocketConnection) {
|
||||
final PlayerSocketConnection socketConnection = (PlayerSocketConnection) playerConnection;
|
||||
socketConnection.writeAndFlush(disconnectPacket);
|
||||
playerConnection.disconnect();
|
||||
try {
|
||||
socketConnection.getChannel().close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
player.remove();
|
||||
}
|
||||
}
|
||||
this.players.clear();
|
||||
|
Loading…
Reference in New Issue
Block a user