mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-06 16:37:38 +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) {
|
if (playerConnection instanceof PlayerSocketConnection) {
|
||||||
final PlayerSocketConnection socketConnection = (PlayerSocketConnection) playerConnection;
|
final PlayerSocketConnection socketConnection = (PlayerSocketConnection) playerConnection;
|
||||||
socketConnection.writeAndFlush(disconnectPacket);
|
socketConnection.writeAndFlush(disconnectPacket);
|
||||||
|
playerConnection.disconnect();
|
||||||
try {
|
try {
|
||||||
socketConnection.getChannel().close();
|
socketConnection.getChannel().close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
player.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.players.clear();
|
this.players.clear();
|
||||||
|
Loading…
Reference in New Issue
Block a user