Search in sources :

Example 1 with AuthenticationUnavailableException

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");
        }
    }
}
Also used : AuthenticationUnavailableException(net.minecraft.util.com.mojang.authlib.exceptions.AuthenticationUnavailableException) GameProfile(net.minecraft.util.com.mojang.authlib.GameProfile) BigInteger(java.math.BigInteger)

Aggregations

BigInteger (java.math.BigInteger)1 GameProfile (net.minecraft.util.com.mojang.authlib.GameProfile)1 AuthenticationUnavailableException (net.minecraft.util.com.mojang.authlib.exceptions.AuthenticationUnavailableException)1