diff options
author | Travis Watkins <amaranth@ubuntu.com> | 2014-04-10 20:04:38 -0500 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2014-04-11 22:28:35 -0500 |
commit | 8f771c737850130534b0fade70494f7ce3cbc8fd (patch) | |
tree | e4180121cdaf4f15b325aa059469b44975fca8a4 /src/main/java/net/minecraft/server/ThreadPlayerLookupUUID.java | |
parent | 0df7555cecff17ffab68b8280dcf8471b10f020c (diff) | |
download | craftbukkit-8f771c737850130534b0fade70494f7ce3cbc8fd.tar craftbukkit-8f771c737850130534b0fade70494f7ce3cbc8fd.tar.gz craftbukkit-8f771c737850130534b0fade70494f7ce3cbc8fd.tar.lz craftbukkit-8f771c737850130534b0fade70494f7ce3cbc8fd.tar.xz craftbukkit-8f771c737850130534b0fade70494f7ce3cbc8fd.zip |
Update CraftBukkit to Minecraft 1.7.8
Diffstat (limited to 'src/main/java/net/minecraft/server/ThreadPlayerLookupUUID.java')
-rw-r--r-- | src/main/java/net/minecraft/server/ThreadPlayerLookupUUID.java | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/src/main/java/net/minecraft/server/ThreadPlayerLookupUUID.java b/src/main/java/net/minecraft/server/ThreadPlayerLookupUUID.java index 496b7c98..6b91be70 100644 --- a/src/main/java/net/minecraft/server/ThreadPlayerLookupUUID.java +++ b/src/main/java/net/minecraft/server/ThreadPlayerLookupUUID.java @@ -1,6 +1,7 @@ package net.minecraft.server; import java.math.BigInteger; +import java.util.UUID; import net.minecraft.util.com.mojang.authlib.GameProfile; import net.minecraft.util.com.mojang.authlib.exceptions.AuthenticationUnavailableException; @@ -21,20 +22,22 @@ class ThreadPlayerLookupUUID extends Thread { } public void run() { + GameProfile gameprofile = LoginListener.a(this.a); + try { - String s = (new BigInteger(MinecraftEncryption.a(LoginListener.a(this.a), LoginListener.b(this.a).J().getPublic(), LoginListener.c(this.a)))).toString(16); + 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.b(this.a).at().hasJoinedServer(new GameProfile((String) null, LoginListener.d(this.a).getName()), s)); - if (LoginListener.d(this.a) != null) { + LoginListener.a(this.a, LoginListener.c(this.a).av().hasJoinedServer(new GameProfile((UUID) null, gameprofile.getName()), s)); + if (LoginListener.a(this.a) != null) { // CraftBukkit start - fire PlayerPreLoginEvent if (!this.a.networkManager.isConnected()) { return; } - String playerName = LoginListener.d(this.a).getName(); + String playerName = LoginListener.a(this.a).getName(); java.net.InetAddress address = ((java.net.InetSocketAddress) a.networkManager.getSocketAddress()).getAddress(); - java.util.UUID uniqueId = UtilUUID.b(LoginListener.d(this.a).getId()); - final org.bukkit.craftbukkit.CraftServer server = LoginListener.b(this.a).server; + java.util.UUID uniqueId = LoginListener.a(this.a).getId(); + final org.bukkit.craftbukkit.CraftServer server = LoginListener.c(this.a).server; AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, uniqueId); server.getPluginManager().callEvent(asyncEvent); @@ -51,7 +54,7 @@ class ThreadPlayerLookupUUID extends Thread { return event.getResult(); }}; - LoginListener.b(this.a).processQueue.add(waitable); + LoginListener.c(this.a).processQueue.add(waitable); if (waitable.get() != PlayerPreLoginEvent.Result.ALLOWED) { this.a.disconnect(event.getKickMessage()); return; @@ -64,19 +67,29 @@ class ThreadPlayerLookupUUID extends Thread { } // CraftBukkit end - LoginListener.e().info("UUID of player " + LoginListener.d(this.a).getName() + " is " + LoginListener.d(this.a).getId()); + 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.d(this.a).getName() + "\' tried to join with an invalid session"); + LoginListener.e().error("Username \'" + LoginListener.a(this.a).getName() + "\' tried to join with an invalid session"); } } catch (AuthenticationUnavailableException authenticationunavailableexception) { - this.a.disconnect("Authentication servers are down. Please try again later, sorry!"); - LoginListener.e().error("Couldn\'t verify username because servers are unavailable"); + 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"); + } // CraftBukkit start - catch all exceptions } catch (Exception exception) { this.a.disconnect("Failed to verify username!"); - LoginListener.b(this.a).server.getLogger().log(java.util.logging.Level.WARNING, "Exception verifying " + LoginListener.d(this.a).getName(), exception); + LoginListener.c(this.a).server.getLogger().log(java.util.logging.Level.WARNING, "Exception verifying " + LoginListener.a(this.a).getName(), exception); // CraftBukkit end } } |