From 16e823a55d969ba26707f075e871136e3e7a6764 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Tue, 17 Oct 2017 21:40:53 +0100 Subject: [PATCH] Don't send keepalive logger message if we've already disconnected --- .../Increase-time-allowed-for-a-keepalive-reply.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Spigot-Server-Patches/Increase-time-allowed-for-a-keepalive-reply.patch b/Spigot-Server-Patches/Increase-time-allowed-for-a-keepalive-reply.patch index be92e8ec39..ac79c41a89 100644 --- a/Spigot-Server-Patches/Increase-time-allowed-for-a-keepalive-reply.patch +++ b/Spigot-Server-Patches/Increase-time-allowed-for-a-keepalive-reply.patch @@ -10,7 +10,7 @@ tempermental due to lag spikes on the network thread, e.g. that caused by plugins that are interacting with netty. diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 26fbb30f9..5bb6d9fac 100644 +index 26fbb30f9..71fae9450 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 { @@ -33,7 +33,7 @@ index 26fbb30f9..5bb6d9fac 100644 + long elapsedTime = currentTime - this.getLastPing(); + if (this.isPendingPing()) { + // We're pending a ping from the client -+ if (elapsedTime >= 30000L) { // 30 seconds for a ping reply ++ if (!this.processedDisconnect && elapsedTime >= 30000L) { // 30 seconds for a ping reply also, 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")); + }