Close issue #24 by adding hostname paramater to login event

This commit is contained in:
md_5 2012-11-02 09:21:17 +11:00
parent 6f005064a1
commit 88babcaea1
2 changed files with 5 additions and 1 deletions

View File

@ -39,7 +39,7 @@ public class InitialHandler implements Runnable
case 0x02: case 0x02:
Packet2Handshake handshake = new Packet2Handshake(packet); Packet2Handshake handshake = new Packet2Handshake(packet);
// fire connect event // fire connect event
LoginEvent event = new LoginEvent(handshake.username, socket.getInetAddress()); LoginEvent event = new LoginEvent(handshake.username, socket.getInetAddress(), handshake.host);
BungeeCord.instance.pluginManager.onHandshake(event); BungeeCord.instance.pluginManager.onHandshake(event);
if (event.isCancelled()) if (event.isCancelled())
{ {

View File

@ -26,4 +26,8 @@ public class LoginEvent implements Cancellable
* IP address of the remote connection. * IP address of the remote connection.
*/ */
private final InetAddress address; private final InetAddress address;
/**
* Hostname which the user tried to connect to.
*/
private final String hostname;
} }