diff options
author | sk89q <the.sk89q@gmail.com> | 2011-09-26 15:32:05 -0700 |
---|---|---|
committer | sk89q <the.sk89q@gmail.com> | 2011-09-26 15:32:05 -0700 |
commit | afd95b7e309309cdfb59ed62c4303a18544e3c83 (patch) | |
tree | 18cab1a417f38b17112edcab0cf78be181bd2aba /src/main/java/net/minecraft/server/NetLoginHandler.java | |
parent | 87494d46f86738084c52f20acb399f787a436ba5 (diff) | |
download | craftbukkit-afd95b7e309309cdfb59ed62c4303a18544e3c83.tar craftbukkit-afd95b7e309309cdfb59ed62c4303a18544e3c83.tar.gz craftbukkit-afd95b7e309309cdfb59ed62c4303a18544e3c83.tar.lz craftbukkit-afd95b7e309309cdfb59ed62c4303a18544e3c83.tar.xz craftbukkit-afd95b7e309309cdfb59ed62c4303a18544e3c83.zip |
Added server list ping event.
Diffstat (limited to 'src/main/java/net/minecraft/server/NetLoginHandler.java')
-rw-r--r-- | src/main/java/net/minecraft/server/NetLoginHandler.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/NetLoginHandler.java b/src/main/java/net/minecraft/server/NetLoginHandler.java index a9da6898..e7d6d6e2 100644 --- a/src/main/java/net/minecraft/server/NetLoginHandler.java +++ b/src/main/java/net/minecraft/server/NetLoginHandler.java @@ -5,6 +5,11 @@ import java.util.Iterator; import java.util.Random; import java.util.logging.Logger; +// CraftBukkit start +import org.bukkit.craftbukkit.event.CraftEventFactory; +import org.bukkit.event.server.ServerListPingEvent; +// CraftBukkit end + public class NetLoginHandler extends NetHandler { public static Logger a = Logger.getLogger("Minecraft"); @@ -139,7 +144,10 @@ public class NetLoginHandler extends NetHandler { public void a(Packet254GetInfo packet254getinfo) { if (this.networkManager.f() == null) return; // CraftBukkit - fix NPE when a client queries a server that is unable to handle it. try { - String s = this.server.p + "\u00A7" + this.server.serverConfigurationManager.g() + "\u00A7" + this.server.serverConfigurationManager.h(); + // CraftBukkit start + ServerListPingEvent pingEvent = CraftEventFactory.callServerListPingEvent(this.server.server, getSocket().getInetAddress(), this.server.p, this.server.serverConfigurationManager.g(), this.server.serverConfigurationManager.h()); + String s = pingEvent.getMotd() + "\u00A7" + this.server.serverConfigurationManager.g() + "\u00A7" + pingEvent.getMaxPlayers(); + // CraftBukkit end this.networkManager.queue(new Packet255KickDisconnect(s)); this.networkManager.d(); |