From e22501a8e39b8f234bfbedbe0560b6f8f425a818 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Tue, 20 Feb 2024 16:25:21 -0800 Subject: [PATCH] Remove pending connections for login VERIFYING state The login state PROTOCOL_SWITCHING is only set once the player passes initial login checks during the VERIFYING state (ban,whitelist,slots,login event), but we add to pending during the VERIFYING state. Fixes https://github.com/PaperMC/Folia/issues/201 https://github.com/PaperMC/Folia/issues/200 --- patches/server/0003-Threaded-Regions.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/server/0003-Threaded-Regions.patch b/patches/server/0003-Threaded-Regions.patch index eaf3c7e..9b21932 100644 --- a/patches/server/0003-Threaded-Regions.patch +++ b/patches/server/0003-Threaded-Regions.patch @@ -9708,7 +9708,7 @@ index cb308808906a8cdb127df8284e106e00553473ca..05bc1f010b50e673e9a185d96e338bae } diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java -index 4716f8bd8a64d4f20f0d5957c1e7fabf63020f43..14c82f0903d08e289cec49d095af986b83b500aa 100644 +index 4716f8bd8a64d4f20f0d5957c1e7fabf63020f43..18b8651147dedcf80d9baf04e87fb25cfbf9b89f 100644 --- a/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java @@ -84,7 +84,7 @@ public class Connection extends SimpleChannelInboundHandler> { @@ -9994,7 +9994,7 @@ index 4716f8bd8a64d4f20f0d5957c1e7fabf63020f43..14c82f0903d08e289cec49d095af986b + commonPacketListener.getOwner().getId(), this + ); + } else if (packetlistener instanceof net.minecraft.server.network.ServerLoginPacketListenerImpl loginPacketListener) { -+ if (loginPacketListener.state.ordinal() >= net.minecraft.server.network.ServerLoginPacketListenerImpl.State.PROTOCOL_SWITCHING.ordinal()) { ++ if (loginPacketListener.state.ordinal() >= net.minecraft.server.network.ServerLoginPacketListenerImpl.State.VERIFYING.ordinal()) { + net.minecraft.server.MinecraftServer.getServer().getPlayerList().removeConnection( + loginPacketListener.authenticatedProfile.getName(), + loginPacketListener.authenticatedProfile.getId(), this