mirror of
https://github.com/PaperMC/Paper.git
synced 2024-08-19 18:53:23 +02:00
We cannot put blocking network I/O onto the worldgen threads, this will crash the server if it stalls
25 lines
1.3 KiB
Diff
25 lines
1.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: killme <killme-git@ibts.me>
|
|
Date: Sun, 12 Nov 2017 19:40:01 +0100
|
|
Subject: [PATCH] Prevent logins from being processed when the player has
|
|
disconnected
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
|
index d2f0450c6bae722bfa9162b027e723eb10b22c78..145f3eae6622453d47769e10fb30ce8d31d5f847 100644
|
|
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
|
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
|
@@ -86,7 +86,11 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
|
|
}
|
|
// Paper end
|
|
if (this.state == ServerLoginPacketListenerImpl.State.READY_TO_ACCEPT) {
|
|
- this.handleAcceptedLogin();
|
|
+ // Paper start - prevent logins to be processed even though disconnect was called
|
|
+ if (connection.isConnected()) {
|
|
+ this.handleAcceptedLogin();
|
|
+ }
|
|
+ // Paper end
|
|
} else if (this.state == ServerLoginPacketListenerImpl.State.DELAY_ACCEPT) {
|
|
ServerPlayer entityplayer = this.server.getPlayerList().getPlayer(this.gameProfile.getId());
|
|
|