Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-267906

LAN host exiting world keeps players connected until timed out

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • None
    • 1.20.4
    • None
    • Unconfirmed
    • (Unassigned)

      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.

            Unassigned Unassigned
            sirshady88 sirshady88
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: