diff --git a/Spigot-Server-Patches/AsyncTabCompleteEvent.patch b/Spigot-Server-Patches/AsyncTabCompleteEvent.patch index 6f51d9debb..cafd689409 100644 --- a/Spigot-Server-Patches/AsyncTabCompleteEvent.patch +++ b/Spigot-Server-Patches/AsyncTabCompleteEvent.patch @@ -14,7 +14,7 @@ completion, such as offline players. Also adds isCommand and getLocation to the sync TabCompleteEvent diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 5a620f3fd..ead0994f8 100644 +index d0ab87d0f..ca054afcf 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { diff --git a/Spigot-Server-Patches/Increase-time-allowed-for-a-keepalive-reply.patch b/Spigot-Server-Patches/revert-serverside-behavior-of-keepalives.patch similarity index 65% rename from Spigot-Server-Patches/Increase-time-allowed-for-a-keepalive-reply.patch rename to Spigot-Server-Patches/revert-serverside-behavior-of-keepalives.patch index 9b5445728f..8e0523f65e 100644 --- a/Spigot-Server-Patches/Increase-time-allowed-for-a-keepalive-reply.patch +++ b/Spigot-Server-Patches/revert-serverside-behavior-of-keepalives.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sun, 15 Oct 2017 00:29:07 +0100 -Subject: [PATCH] Increase time allowed for a keepalive reply +Subject: [PATCH] revert serverside behavior of keepalives This patch intends to bump up the time that a client has to reply to the server back to 30 seconds as per pre 1.12.2, which allowed clients @@ -9,10 +9,25 @@ more than enough time to reply potentially allowing them to be less tempermental due to lag spikes on the network thread, e.g. that caused by plugins that are interacting with netty. +We also add a system property to allow people to tweak how long the server +will wait for a reply. There is a compromise here between lower and higher +values, lower values will mean that dead connections can be closed sooner, +whereas higher values will make this less sensitive to issues such as spikes +from networking or during connections flood of chunk packets on slower clients, + at the cost of dead connections being kept open for longer. + diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index a92bf8967..5a620f3fd 100644 +index a92bf8967..d0ab87d0f 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java +@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { + private int receivedMovePackets; + private int processedMovePackets; + private AutoRecipe H = new AutoRecipe(); ++ private static final long KEEPALIVE_LIMIT = Long.getLong("paper.playerconnection.keepalive", 30) * 1000; // Paper - provide property to set keepalive limit + + public PlayerConnection(MinecraftServer minecraftserver, NetworkManager networkmanager, EntityPlayer entityplayer) { + this.minecraftServer = minecraftserver; @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { } @@ -33,7 +48,7 @@ index a92bf8967..5a620f3fd 100644 + long elapsedTime = currentTime - this.getLastPing(); + if (this.isPendingPing()) { + // We're pending a ping from the client -+ if (!this.processedDisconnect && elapsedTime >= 30000L) { // 30 seconds for a ping reply also, don't fire if already disconnected ++ if (!this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // check keepalive limit, don't fire if already disconnected + PlayerConnection.LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getName()); // more info + this.disconnect(new ChatMessage("disconnect.timeout")); + }