diff --git a/Spigot-Server-Patches/0244-Increase-time-allowed-for-a-keepalive-reply.patch b/Spigot-Server-Patches/0244-revert-serverside-behavior-of-keepalives.patch similarity index 62% rename from Spigot-Server-Patches/0244-Increase-time-allowed-for-a-keepalive-reply.patch rename to Spigot-Server-Patches/0244-revert-serverside-behavior-of-keepalives.patch index a99cbc2408..b1eed4295f 100644 --- a/Spigot-Server-Patches/0244-Increase-time-allowed-for-a-keepalive-reply.patch +++ b/Spigot-Server-Patches/0244-revert-serverside-behavior-of-keepalives.patch @@ -1,7 +1,7 @@ -From b9e5686a9c938851a0a3b41e34f0558890d6623a Mon Sep 17 00:00:00 2001 +From 4857743f854572e63bd512528de0c968091a2ced 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,11 +9,26 @@ 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 -@@ -179,18 +179,25 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -100,6 +100,7 @@ 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; +@@ -179,18 +180,25 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { } this.minecraftServer.methodProfiler.a("keepAlive"); @@ -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")); + } diff --git a/Spigot-Server-Patches/0254-AsyncTabCompleteEvent.patch b/Spigot-Server-Patches/0254-AsyncTabCompleteEvent.patch index fa1a497889..e01c66c1bd 100644 --- a/Spigot-Server-Patches/0254-AsyncTabCompleteEvent.patch +++ b/Spigot-Server-Patches/0254-AsyncTabCompleteEvent.patch @@ -1,4 +1,4 @@ -From e7430c9e25f8ac7b7af64a674489b50a5438c194 Mon Sep 17 00:00:00 2001 +From 53cac62ad4cf6b9c379fae5f0d51720ca5d4e886 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 26 Nov 2017 13:19:58 -0500 Subject: [PATCH] AsyncTabCompleteEvent @@ -14,10 +14,10 @@ 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 -@@ -2275,24 +2275,51 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -2276,24 +2276,51 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { // CraftBukkit end }