From d9be210fe31b0147e0987d73326b9f842370c9c7 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Fri, 23 Nov 2018 18:54:53 -0500 Subject: [PATCH] Fix this up --- .../proxy/connection/backend/VelocityServerConnection.java | 3 +++ .../proxy/connection/client/ConnectedPlayer.java | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/VelocityServerConnection.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/VelocityServerConnection.java index aff20854c..47e18c9b1 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/VelocityServerConnection.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/VelocityServerConnection.java @@ -94,6 +94,9 @@ public class VelocityServerConnection implements MinecraftConnectionAssociation, new LoginSessionHandler(server, VelocityServerConnection.this, result)); startHandshake(); } else { + // We need to remember to reset the in-flight connection to allow connect() to work + // properly. + proxyPlayer.resetInFlightConnection(); result.completeExceptionally(future.cause()); } }); 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 c99a5764a..328e5c2aa 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 @@ -286,6 +286,10 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player { return connectedServer; } + public void resetInFlightConnection() { + connectionInFlight = null; + } + public void handleConnectionException(RegisteredServer server, Throwable throwable) { if (throwable == null) { throw new NullPointerException("throwable");