From c6dcba36c34c0a9764e8f4647ac8b377520429f4 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Wed, 20 Feb 2019 13:55:18 -0500 Subject: [PATCH] Fix another case where an in-flight connection would be retained. --- .../proxy/connection/client/ConnectedPlayer.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java index 243378283..ad32a68ec 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java @@ -362,7 +362,7 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player { Optional nextServer = getNextServerToTry(rs); if (nextServer.isPresent()) { // There can't be any connection in flight now. - connectionInFlight = null; + resetInFlightConnection(); createConnectionRequest(nextServer.get()).fireAndForget(); } else { @@ -376,6 +376,10 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player { result = next.map(RedirectPlayer::create) .orElseGet(() -> DisconnectPlayer.create(friendlyReason)); } else { + // If we were kicked by going to another server, the connection should not be in flight + if (connectionInFlight != null && connectionInFlight.getServer().equals(rs)) { + resetInFlightConnection(); + } result = Notify.create(friendlyReason); } KickedFromServerEvent originalEvent = new KickedFromServerEvent(this, rs, kickReason,