use of net.minecraft.util.com.mojang.authlib.exceptions.AuthenticationUnavailableException in project mc-dev by Bukkit.
the class ThreadPlayerLookupUUID method run.
public void run() {
GameProfile gameprofile = LoginListener.a(this.a);
try {
String s = (new BigInteger(MinecraftEncryption.a(LoginListener.b(this.a), LoginListener.c(this.a).K().getPublic(), LoginListener.d(this.a)))).toString(16);
LoginListener.a(this.a, LoginListener.c(this.a).av().hasJoinedServer(new GameProfile((UUID) null, gameprofile.getName()), s));
if (LoginListener.a(this.a) != null) {
LoginListener.e().info("UUID of player " + LoginListener.a(this.a).getName() + " is " + LoginListener.a(this.a).getId());
LoginListener.a(this.a, EnumProtocolState.READY_TO_ACCEPT);
} else if (LoginListener.c(this.a).N()) {
LoginListener.e().warn("Failed to verify username but will let them in anyway!");
LoginListener.a(this.a, this.a.a(gameprofile));
LoginListener.a(this.a, EnumProtocolState.READY_TO_ACCEPT);
} else {
this.a.disconnect("Failed to verify username!");
LoginListener.e().error("Username \'" + LoginListener.a(this.a).getName() + "\' tried to join with an invalid session");
}
} catch (AuthenticationUnavailableException authenticationunavailableexception) {
if (LoginListener.c(this.a).N()) {
LoginListener.e().warn("Authentication servers are down but will let them in anyway!");
LoginListener.a(this.a, this.a.a(gameprofile));
LoginListener.a(this.a, EnumProtocolState.READY_TO_ACCEPT);
} else {
this.a.disconnect("Authentication servers are down. Please try again later, sorry!");
LoginListener.e().error("Couldn\'t verify username because servers are unavailable");
}
}
}
Aggregations