From 88babcaea1bedac05d21f3774c00a5dd5981f65d Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 2 Nov 2012 09:21:17 +1100 Subject: [PATCH] Close issue #24 by adding hostname paramater to login event --- src/main/java/net/md_5/bungee/InitialHandler.java | 2 +- src/main/java/net/md_5/bungee/plugin/LoginEvent.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/md_5/bungee/InitialHandler.java b/src/main/java/net/md_5/bungee/InitialHandler.java index 974a77c0..785de47d 100644 --- a/src/main/java/net/md_5/bungee/InitialHandler.java +++ b/src/main/java/net/md_5/bungee/InitialHandler.java @@ -39,7 +39,7 @@ public class InitialHandler implements Runnable case 0x02: Packet2Handshake handshake = new Packet2Handshake(packet); // 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); if (event.isCancelled()) { diff --git a/src/main/java/net/md_5/bungee/plugin/LoginEvent.java b/src/main/java/net/md_5/bungee/plugin/LoginEvent.java index 518cbfae..16479c84 100644 --- a/src/main/java/net/md_5/bungee/plugin/LoginEvent.java +++ b/src/main/java/net/md_5/bungee/plugin/LoginEvent.java @@ -26,4 +26,8 @@ public class LoginEvent implements Cancellable * IP address of the remote connection. */ private final InetAddress address; + /** + * Hostname which the user tried to connect to. + */ + private final String hostname; }