Skip to content

Commit

Permalink
Added "hostname" to event data for player_login event.
Browse files Browse the repository at this point in the history
  • Loading branch information
VergilPrime committed Nov 23, 2015
1 parent c0aadb8 commit 5b351cb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
Expand Up @@ -374,6 +374,11 @@ public void setResult(String rst) {
public String getIP() {
return event.getAddress().getHostAddress();
}

@Override
public String getHostname() {
return event.getHostname();
}
}

public static class BukkitMCPlayerPreLoginEvent implements MCPlayerPreLoginEvent {
Expand Down
Expand Up @@ -12,4 +12,5 @@ public interface MCPlayerLoginEvent extends MCPlayerEvent{
public String getResult();
public void setResult(String rst);
public String getIP();
public String getHostname();
}
Expand Up @@ -637,6 +637,7 @@ public String docs() {
+ "can specify the kick message by modifying 'kickmsg'. "
+ "{player: The player's name | uuid: The player's unique id | "
+ "kickmsg: The default kick message | ip: the player's IP address | "
+ "hostname: The hostname used to reach the server | "
+ "result: the default response to their logging in}"
+ "{kickmsg|result}"
+ "{player|kickmsg|ip|result}";
Expand Down Expand Up @@ -675,6 +676,7 @@ public Map<String, Construct> evaluate(BindableEvent e)
//TODO: The event.getResult needs to be enum'd
map.put("result", new CString(event.getResult(), Target.UNKNOWN));
map.put("kickmsg", new CString(event.getKickMessage(), Target.UNKNOWN));
map.put("hostname", new CString(event.getHostname(), Target.UNKNOWN));

return map;
} else{
Expand Down

0 comments on commit 5b351cb

Please sign in to comment.