Created
November 8, 2013 06:39
-
-
Save daboross/7367119 to your computer and use it in GitHub Desktop.
Proxy ping event to persuade players to use new IP.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@EventHandler | |
public void onPing(ProxyPingEvent evt) { | |
ServerPing ping = evt.getResponse(); | |
InetSocketAddress hostAddress = evt.getConnection().getVirtualHost(); | |
String host = hostAddress == null ? null : hostAddress.getHostString(); | |
if (host != null && !host.contains("the-ip-you-should-use.net")) { | |
ping.setDescription("You aren't using the new IP! Be gone!"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment