From 919e84c23f9dad98fd41e09230b30858d77493f0 Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Thu, 12 Aug 2021 14:35:26 -0400 Subject: [PATCH] Don't try to connect to the remote server with invalid credentials Fixes #2458 --- .../connector/network/session/GeyserSession.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/connector/src/main/java/org/geysermc/connector/network/session/GeyserSession.java b/connector/src/main/java/org/geysermc/connector/network/session/GeyserSession.java index c8d60c1ea..f814a787a 100644 --- a/connector/src/main/java/org/geysermc/connector/network/session/GeyserSession.java +++ b/connector/src/main/java/org/geysermc/connector/network/session/GeyserSession.java @@ -590,9 +590,17 @@ public class GeyserSession implements CommandSender { disconnect(LanguageUtils.getPlayerLocaleString("geyser.auth.login.invalid.kick", getClientData().getLanguageCode())); } catch (RequestException ex) { ex.printStackTrace(); + disconnect(ex.getMessage()); } return null; - }).whenComplete((aVoid, ex) -> connectDownstream()); + }).whenComplete((aVoid, ex) -> { + if (this.closed) { + // Client disconnected during the authentication attempt + return; + } + + connectDownstream(); + }); } /**