Skip to content

Commit

Permalink
Remove pending connections for login VERIFYING state
Browse files Browse the repository at this point in the history
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 #201 #200
  • Loading branch information
Spottedleaf committed Feb 21, 2024
1 parent 7a3dea9 commit e22501a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions patches/server/0003-Threaded-Regions.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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<Packet<?>> {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e22501a

Please sign in to comment.