diff options
author | feildmaster <admin@feildmaster.com> | 2012-12-19 22:03:52 -0600 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2012-12-20 10:43:00 -0600 |
commit | 23b67643741d5754af4de020a29d557078f9f81d (patch) | |
tree | 90e1a32f7eb94af49a381cb6bc34bf6247f0efe6 /src/main/java/net/minecraft/server/ThreadLoginVerifier.java | |
parent | 9f1bf124eec7c20f16b2034fd9fba55f70c805fd (diff) | |
download | craftbukkit-23b67643741d5754af4de020a29d557078f9f81d.tar craftbukkit-23b67643741d5754af4de020a29d557078f9f81d.tar.gz craftbukkit-23b67643741d5754af4de020a29d557078f9f81d.tar.lz craftbukkit-23b67643741d5754af4de020a29d557078f9f81d.tar.xz craftbukkit-23b67643741d5754af4de020a29d557078f9f81d.zip |
Update CraftBukkit to Minecraft 1.4.6
Diffstat (limited to 'src/main/java/net/minecraft/server/ThreadLoginVerifier.java')
-rw-r--r-- | src/main/java/net/minecraft/server/ThreadLoginVerifier.java | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/main/java/net/minecraft/server/ThreadLoginVerifier.java b/src/main/java/net/minecraft/server/ThreadLoginVerifier.java index 8bb1f71e..0686ba0f 100644 --- a/src/main/java/net/minecraft/server/ThreadLoginVerifier.java +++ b/src/main/java/net/minecraft/server/ThreadLoginVerifier.java @@ -15,40 +15,40 @@ import org.bukkit.event.player.PlayerPreLoginEvent; class ThreadLoginVerifier extends Thread { - final NetLoginHandler netLoginHandler; + final PendingConnection pendingConnection; // CraftBukkit start CraftServer server; - ThreadLoginVerifier(NetLoginHandler netloginhandler, CraftServer server) { + ThreadLoginVerifier(PendingConnection pendingconnection, CraftServer server) { this.server = server; // CraftBukkit end - this.netLoginHandler = netloginhandler; + this.pendingConnection = pendingconnection; } public void run() { try { - String s = (new BigInteger(MinecraftEncryption.a(NetLoginHandler.a(this.netLoginHandler), NetLoginHandler.b(this.netLoginHandler).F().getPublic(), NetLoginHandler.c(this.netLoginHandler)))).toString(16); - URL url = new URL("http://session.minecraft.net/game/checkserver.jsp?user=" + URLEncoder.encode(NetLoginHandler.d(this.netLoginHandler), "UTF-8") + "&serverId=" + URLEncoder.encode(s, "UTF-8")); + String s = (new BigInteger(MinecraftEncryption.a(PendingConnection.a(this.pendingConnection), PendingConnection.b(this.pendingConnection).F().getPublic(), PendingConnection.c(this.pendingConnection)))).toString(16); + URL url = new URL("http://session.minecraft.net/game/checkserver.jsp?user=" + URLEncoder.encode(PendingConnection.d(this.pendingConnection), "UTF-8") + "&serverId=" + URLEncoder.encode(s, "UTF-8")); BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(url.openStream())); String s1 = bufferedreader.readLine(); bufferedreader.close(); if (!"YES".equals(s1)) { - this.netLoginHandler.disconnect("Failed to verify username!"); + this.pendingConnection.disconnect("Failed to verify username!"); return; } // CraftBukkit start - if (this.netLoginHandler.getSocket() == null) { + if (this.pendingConnection.getSocket() == null) { return; } - AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(NetLoginHandler.d(this.netLoginHandler), this.netLoginHandler.getSocket().getInetAddress()); + AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(PendingConnection.d(this.pendingConnection), this.pendingConnection.getSocket().getInetAddress()); this.server.getPluginManager().callEvent(asyncEvent); if (PlayerPreLoginEvent.getHandlerList().getRegisteredListeners().length != 0) { - final PlayerPreLoginEvent event = new PlayerPreLoginEvent(NetLoginHandler.d(this.netLoginHandler), this.netLoginHandler.getSocket().getInetAddress()); + final PlayerPreLoginEvent event = new PlayerPreLoginEvent(PendingConnection.d(this.pendingConnection), this.pendingConnection.getSocket().getInetAddress()); if (asyncEvent.getResult() != PlayerPreLoginEvent.Result.ALLOWED) { event.disallow(asyncEvent.getResult(), asyncEvent.getKickMessage()); } @@ -59,26 +59,26 @@ class ThreadLoginVerifier extends Thread { return event.getResult(); }}; - NetLoginHandler.b(this.netLoginHandler).processQueue.add(waitable); + PendingConnection.b(this.pendingConnection).processQueue.add(waitable); if (waitable.get() != PlayerPreLoginEvent.Result.ALLOWED) { - this.netLoginHandler.disconnect(event.getKickMessage()); + this.pendingConnection.disconnect(event.getKickMessage()); return; } } else { if (asyncEvent.getLoginResult() != AsyncPlayerPreLoginEvent.Result.ALLOWED) { - this.netLoginHandler.disconnect(asyncEvent.getKickMessage()); + this.pendingConnection.disconnect(asyncEvent.getKickMessage()); return; } } // CraftBukkit end - NetLoginHandler.a(this.netLoginHandler, true); + PendingConnection.a(this.pendingConnection, true); // CraftBukkit start } catch (java.io.IOException exception) { - this.netLoginHandler.disconnect("Failed to verify username, session authentication server unavailable!"); + this.pendingConnection.disconnect("Failed to verify username, session authentication server unavailable!"); } catch (Exception exception) { - this.netLoginHandler.disconnect("Failed to verify username!"); - server.getLogger().log(java.util.logging.Level.WARNING, "Exception verifying " + NetLoginHandler.d(this.netLoginHandler), exception); + this.pendingConnection.disconnect("Failed to verify username!"); + server.getLogger().log(java.util.logging.Level.WARNING, "Exception verifying " + PendingConnection.d(this.pendingConnection), exception); // CraftBukkit end } } |