From bf2835da02a0ebc374fc7239e4f0c2e74bfb61fc Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Fri, 27 Jul 2018 01:26:15 -0400 Subject: [PATCH] Schedule the response handler to run in the channel event loop --- .../proxy/connection/client/LoginSessionHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/velocitypowered/proxy/connection/client/LoginSessionHandler.java b/src/main/java/com/velocitypowered/proxy/connection/client/LoginSessionHandler.java index 03bb63598..c89b69d65 100644 --- a/src/main/java/com/velocitypowered/proxy/connection/client/LoginSessionHandler.java +++ b/src/main/java/com/velocitypowered/proxy/connection/client/LoginSessionHandler.java @@ -60,7 +60,7 @@ public class LoginSessionHandler implements MinecraftSessionHandler { String playerIp = ((InetSocketAddress) inbound.getChannel().remoteAddress()).getHostString(); VelocityServer.getServer().getHttpClient() .get(new URL(String.format(MOJANG_SERVER_AUTH_URL, login.getUsername(), serverId, playerIp))) - .thenAccept(profileResponse -> { + .thenAcceptAsync(profileResponse -> { try { inbound.enableEncryption(decryptedSharedSecret); } catch (GeneralSecurityException e) { @@ -69,7 +69,7 @@ public class LoginSessionHandler implements MinecraftSessionHandler { GameProfile profile = VelocityServer.GSON.fromJson(profileResponse, GameProfile.class); handleSuccessfulLogin(profile); - }) + }, inbound.getChannel().eventLoop()) .exceptionally(exception -> { System.out.println("Can't enable encryption"); exception.printStackTrace();