From 1ec070069f8a4ed0f530b7ea00577e4ed8410d23 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Tue, 19 Feb 2019 15:09:58 -0500 Subject: [PATCH] Fix misplaced connection in flight reset. Fixes #173 --- .../proxy/connection/client/ConnectedPlayer.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 9122fbe38..243378283 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 @@ -388,13 +388,13 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player { Component friendlyReason) { server.getEventManager().fire(originalEvent) .thenAcceptAsync(event -> { + // There can't be any connection in flight now. + connectionInFlight = null; + if (event.getResult() instanceof DisconnectPlayer) { DisconnectPlayer res = (DisconnectPlayer) event.getResult(); disconnect(res.getReason()); } else if (event.getResult() instanceof RedirectPlayer) { - // There can't be any connection in flight now. - connectionInFlight = null; - RedirectPlayer res = (RedirectPlayer) event.getResult(); createConnectionRequest(res.getServer()) .connectWithIndication()