LAN host exiting world keeps players connected until timed out
On LAN, when a host exits the world, the remaining players do not get disconnected and stay in the world until they timeout.
To reproduce this:
- Open LAN on a world.
- Let another player connect.
- Make the host leave the world.
- The other player will stay on the world until they timeout.
Code issue:
Using yarn mappings, `stop(boolean)` in `IntegratedServer` removes players from the `PlayerManager` using `remove(ServerPlayerEntity)`. `shutdown()` in `MinecraftServer` loops through the players to disconnect them with `disconnectAllPlayers()` in `PlayerManager`. Because `stop(boolean)` is called before `shutdown()`, the player list would be empty, causing players to not be disconnected.
Potential Fix:
In `remove(ServerPlayerEntity)`, check to see if the player is still connected and disconnect them if true.
2024-01-16, 05:06 PM
2024-01-19, 06:43 PM
2024-01-19, 06:43 PM
0
2
-