Mojira Archive
MC-267906

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:

  1. Open LAN on a world.
  2. Let another player connect.
  3. Make the host leave the world.
  4. 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.

Invalid

sirshady88

2024-01-16, 05:06 PM

2024-01-19, 06:43 PM

2024-01-19, 06:43 PM

0

2

Unconfirmed

(Unassigned)

1.20.4

-