mirror of https://github.com/Minestom/Minestom.git
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