13
0
geforkt von Mirrors/Velocity

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