summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2011-11-15 23:01:15 +0000
committerKHobbits <rob@khobbits.co.uk>2011-11-15 23:01:15 +0000
commitf51b92c99e5527c76ffa248fc47d0f74c00d11ed (patch)
tree3f338c97a894dfa5b9911374eb159ce02811550c
parenteda827b244e3cc4cb58513bb6306c154cc3e8d5d (diff)
downloadEssentials-f51b92c99e5527c76ffa248fc47d0f74c00d11ed.tar
Essentials-f51b92c99e5527c76ffa248fc47d0f74c00d11ed.tar.gz
Essentials-f51b92c99e5527c76ffa248fc47d0f74c00d11ed.tar.lz
Essentials-f51b92c99e5527c76ffa248fc47d0f74c00d11ed.tar.xz
Essentials-f51b92c99e5527c76ffa248fc47d0f74c00d11ed.zip
Updating banip to support offline players.
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandbanip.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbanip.java b/Essentials/src/com/earth2me/essentials/commands/Commandbanip.java
index 591542bcb..36ea479f9 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandbanip.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandbanip.java
@@ -30,7 +30,11 @@ public class Commandbanip extends EssentialsCommand
}
else
{
- ess.getServer().banIP(u.getAddress().getAddress().getHostAddress());
+ final String ipAddress = u.getLastLoginAddress();
+ if (ipAddress.length() == 0) {
+ throw new Exception(Util.i18n("playerNotFound"));
+ }
+ ess.getServer().banIP(u.getLastLoginAddress());
sender.sendMessage(Util.i18n("banIpAddress"));
}
}