3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-11-17 05:20:14 +01:00

Schedule the response handler to run in the channel event loop

Dieser Commit ist enthalten in:
Andrew Steinborn 2018-07-27 01:26:15 -04:00
Ursprung 22c7769eae
Commit bf2835da02

Datei anzeigen

@ -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();