From d3bd785289f5832c2e4247c372d3344fdb103a39 Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 28 Jan 2020 20:35:53 +1100 Subject: [PATCH] #2762: Work correctly with disabled timeout --- .../main/java/net/md_5/bungee/connection/DownstreamBridge.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java index e53a3ff90..147110e45 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java @@ -125,7 +125,8 @@ public class DownstreamBridge extends PacketHandler @Override public void handle(KeepAlive alive) throws Exception { - if ( server.getKeepAlives().size() < bungee.getConfig().getTimeout() / 50 ) // Allow a theoretical maximum of 1 keepalive per tick + int timeout = bungee.getConfig().getTimeout(); + if ( timeout <= 0 || server.getKeepAlives().size() < timeout / 50 ) // Some people disable timeout, otherwise allow a theoretical maximum of 1 keepalive per tick { server.getKeepAlives().add( new KeepAliveData( alive.getRandomId(), System.currentTimeMillis() ) ); }