From 8d494242265790df1dc6d92121d1a37b726ac405 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 23 Sep 2017 17:14:03 +1000 Subject: [PATCH] #2261: Don't send any keep alive to server if invalid --- .../src/main/java/net/md_5/bungee/ServerConnection.java | 3 --- .../java/net/md_5/bungee/connection/UpstreamBridge.java | 9 --------- 2 files changed, 12 deletions(-) diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnection.java b/proxy/src/main/java/net/md_5/bungee/ServerConnection.java index a302910681..285e5b8f82 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnection.java @@ -27,9 +27,6 @@ public class ServerConnection implements Server private final boolean forgeServer = false; @Getter @Setter - private boolean pingFailed; - @Getter - @Setter private long sentPingId = -1; private final Unsafe unsafe = new Unsafe() diff --git a/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java b/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java index ad7202d7bc..bb43810bbc 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java @@ -123,15 +123,6 @@ public void handle(KeepAlive alive) throws Exception con.setPing( newPing ); } else { - if ( con.getServer().getSentPingId() != -1 && !con.getServer().isPingFailed() ) - { - alive.setRandomId( con.getServer().getSentPingId() ); - con.getServer().unsafe().sendPacket( alive ); - - con.getServer().setPingFailed( true ); - con.getServer().setSentPingId( -1 ); - } - throw CancelSendSignal.INSTANCE; } }