fix: do not process disconnected queued config->play transition players

This commit is contained in:
mworzala 2024-04-30 13:56:38 -04:00
parent 2a7df1ab55
commit e18d7fb798
No known key found for this signature in database
GPG Key ID: B148F922E64797C7
2 changed files with 3 additions and 1 deletions

View File

@ -12,6 +12,7 @@ import net.minestom.server.MinecraftServer;
import net.minestom.server.command.CommandManager;
import net.minestom.server.entity.Player;
import net.minestom.server.event.server.ServerListPingEvent;
import net.minestom.server.extras.MojangAuth;
import net.minestom.server.extras.lan.OpenToLAN;
import net.minestom.server.extras.lan.OpenToLANConfig;
import net.minestom.server.instance.block.BlockManager;
@ -138,7 +139,7 @@ public class Main {
// VelocityProxy.enable("abcdef");
//BungeeCordProxy.enable();
//MojangAuth.init();
MojangAuth.init();
// useful for testing - we don't need to worry about event calls so just set this to a long time
OpenToLAN.open(new OpenToLANConfig().eventCallDelay(Duration.of(1, TimeUnit.DAY)));

View File

@ -352,6 +352,7 @@ public final class ConnectionManager {
@ApiStatus.Internal
public void updateWaitingPlayers() {
this.waitingPlayers.drain(player -> {
if (!player.isOnline()) return; // Player disconnected while in queued to join
player.getPlayerConnection().setConnectionState(ConnectionState.PLAY);
playPlayers.add(player);
keepAlivePlayers.add(player);