Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-06 00:00:47 +01:00
Schedule the response handler to run in the channel event loop
Dieser Commit ist enthalten in:
Ursprung
22c7769eae
Commit
bf2835da02
@ -60,7 +60,7 @@ public class LoginSessionHandler implements MinecraftSessionHandler {
|
|||||||
String playerIp = ((InetSocketAddress) inbound.getChannel().remoteAddress()).getHostString();
|
String playerIp = ((InetSocketAddress) inbound.getChannel().remoteAddress()).getHostString();
|
||||||
VelocityServer.getServer().getHttpClient()
|
VelocityServer.getServer().getHttpClient()
|
||||||
.get(new URL(String.format(MOJANG_SERVER_AUTH_URL, login.getUsername(), serverId, playerIp)))
|
.get(new URL(String.format(MOJANG_SERVER_AUTH_URL, login.getUsername(), serverId, playerIp)))
|
||||||
.thenAccept(profileResponse -> {
|
.thenAcceptAsync(profileResponse -> {
|
||||||
try {
|
try {
|
||||||
inbound.enableEncryption(decryptedSharedSecret);
|
inbound.enableEncryption(decryptedSharedSecret);
|
||||||
} catch (GeneralSecurityException e) {
|
} catch (GeneralSecurityException e) {
|
||||||
@ -69,7 +69,7 @@ public class LoginSessionHandler implements MinecraftSessionHandler {
|
|||||||
|
|
||||||
GameProfile profile = VelocityServer.GSON.fromJson(profileResponse, GameProfile.class);
|
GameProfile profile = VelocityServer.GSON.fromJson(profileResponse, GameProfile.class);
|
||||||
handleSuccessfulLogin(profile);
|
handleSuccessfulLogin(profile);
|
||||||
})
|
}, inbound.getChannel().eventLoop())
|
||||||
.exceptionally(exception -> {
|
.exceptionally(exception -> {
|
||||||
System.out.println("Can't enable encryption");
|
System.out.println("Can't enable encryption");
|
||||||
exception.printStackTrace();
|
exception.printStackTrace();
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren