Fix this up

This commit is contained in:
Andrew Steinborn
2018-11-23 18:54:53 -05:00
parent 436c1624bc
commit d9be210fe3
2 changed files with 7 additions and 0 deletions

View File

@@ -94,6 +94,9 @@ public class VelocityServerConnection implements MinecraftConnectionAssociation,
new LoginSessionHandler(server, VelocityServerConnection.this, result)); new LoginSessionHandler(server, VelocityServerConnection.this, result));
startHandshake(); startHandshake();
} else { } else {
// We need to remember to reset the in-flight connection to allow connect() to work
// properly.
proxyPlayer.resetInFlightConnection();
result.completeExceptionally(future.cause()); result.completeExceptionally(future.cause());
} }
}); });

View File

@@ -286,6 +286,10 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
return connectedServer; return connectedServer;
} }
public void resetInFlightConnection() {
connectionInFlight = null;
}
public void handleConnectionException(RegisteredServer server, Throwable throwable) { public void handleConnectionException(RegisteredServer server, Throwable throwable) {
if (throwable == null) { if (throwable == null) {
throw new NullPointerException("throwable"); throw new NullPointerException("throwable");