Provide a more descriptive error message if Velocity isn't able to authenticate with Mojang servers
Fixes #636
This commit is contained in:
@@ -145,7 +145,11 @@ public class LoginSessionHandler implements MinecraftSessionHandler {
|
|||||||
try {
|
try {
|
||||||
mcConnection.enableEncryption(decryptedSharedSecret);
|
mcConnection.enableEncryption(decryptedSharedSecret);
|
||||||
} catch (GeneralSecurityException e) {
|
} catch (GeneralSecurityException e) {
|
||||||
throw new RuntimeException(e);
|
logger.error("Unable to enable encryption for connection", e);
|
||||||
|
// At this point, the connection is encrypted, but something's wrong on our side and
|
||||||
|
// we can't do anything about it.
|
||||||
|
mcConnection.close(true);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -163,11 +167,11 @@ public class LoginSessionHandler implements MinecraftSessionHandler {
|
|||||||
logger.error(
|
logger.error(
|
||||||
"Got an unexpected error code {} whilst contacting Mojang to log in {} ({})",
|
"Got an unexpected error code {} whilst contacting Mojang to log in {} ({})",
|
||||||
profileResponse.getStatusCode(), login.getUsername(), playerIp);
|
profileResponse.getStatusCode(), login.getUsername(), playerIp);
|
||||||
mcConnection.close(true);
|
inbound.disconnect(Component.translatable("multiplayer.disconnect.authservers_down"));
|
||||||
}
|
}
|
||||||
} catch (ExecutionException e) {
|
} catch (ExecutionException e) {
|
||||||
logger.error("Unable to authenticate with Mojang", e);
|
logger.error("Unable to authenticate with Mojang", e);
|
||||||
mcConnection.close(true);
|
inbound.disconnect(Component.translatable("multiplayer.disconnect.authservers_down"));
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
// not much we can do usefully
|
// not much we can do usefully
|
||||||
Thread.currentThread().interrupt();
|
Thread.currentThread().interrupt();
|
||||||
|
Reference in New Issue
Block a user