diff options
author | Wesley Wolfe <weswolf@aol.com> | 2012-03-17 20:00:56 -0500 |
---|---|---|
committer | Wesley Wolfe <weswolf@aol.com> | 2012-06-13 23:00:46 -0500 |
commit | 90026906518ea79c2f143c959cb479e5e8200906 (patch) | |
tree | 62179bb65419b79345eafa8ebbd0a266891d523d /src/main/java/net/minecraft/server/ThreadLoginVerifier.java | |
parent | ed6d4c77598d385aae96bc2121726fce167c2688 (diff) | |
download | craftbukkit-90026906518ea79c2f143c959cb479e5e8200906.tar craftbukkit-90026906518ea79c2f143c959cb479e5e8200906.tar.gz craftbukkit-90026906518ea79c2f143c959cb479e5e8200906.tar.lz craftbukkit-90026906518ea79c2f143c959cb479e5e8200906.tar.xz craftbukkit-90026906518ea79c2f143c959cb479e5e8200906.zip |
Implement asynchronous pre-login event; Addresses BUKKIT-1213
Diffstat (limited to 'src/main/java/net/minecraft/server/ThreadLoginVerifier.java')
-rw-r--r-- | src/main/java/net/minecraft/server/ThreadLoginVerifier.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/ThreadLoginVerifier.java b/src/main/java/net/minecraft/server/ThreadLoginVerifier.java index e6e2d7e8..52685c21 100644 --- a/src/main/java/net/minecraft/server/ThreadLoginVerifier.java +++ b/src/main/java/net/minecraft/server/ThreadLoginVerifier.java @@ -7,6 +7,7 @@ import java.net.URLEncoder; // CraftBukkit start import org.bukkit.craftbukkit.CraftServer; +import org.bukkit.event.player.AsyncPlayerPreLoginEvent; import org.bukkit.event.player.PlayerPreLoginEvent; // CraftBukkit end @@ -41,7 +42,13 @@ class ThreadLoginVerifier extends Thread { return; } + AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(this.loginPacket.name, this.netLoginHandler.getSocket().getInetAddress()); + this.server.getPluginManager().callEvent(asyncEvent); + PlayerPreLoginEvent event = new PlayerPreLoginEvent(this.loginPacket.name, this.netLoginHandler.getSocket().getInetAddress()); + if (asyncEvent.getResult() != PlayerPreLoginEvent.Result.ALLOWED) { + event.disallow(asyncEvent.getResult(), asyncEvent.getKickMessage()); + } this.server.getPluginManager().callEvent(event); if (event.getResult() != PlayerPreLoginEvent.Result.ALLOWED) { |