summaryrefslogtreecommitdiffstats
path: root/EssentialsGeoIP/src/com/earth2me/essentials
diff options
context:
space:
mode:
authorsnowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-05-01 19:38:25 +0000
committersnowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-05-01 19:38:25 +0000
commit03fd6249fc61f15d7e153ae66bccc77b0dc36447 (patch)
treef2d6ab3c3b7fd3ffd9bb7bda6c070c7cfec4d3c2 /EssentialsGeoIP/src/com/earth2me/essentials
parent200d79bcec7ce82dfb6b0f6dbd8f372f2cae9270 (diff)
downloadEssentials-03fd6249fc61f15d7e153ae66bccc77b0dc36447.tar
Essentials-03fd6249fc61f15d7e153ae66bccc77b0dc36447.tar.gz
Essentials-03fd6249fc61f15d7e153ae66bccc77b0dc36447.tar.lz
Essentials-03fd6249fc61f15d7e153ae66bccc77b0dc36447.tar.xz
Essentials-03fd6249fc61f15d7e153ae66bccc77b0dc36447.zip
[trunk] Geoip: New permission essentials.geoip.show, that allow the player to see the location of other players.
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1299 e251c2fe-e539-e718-e476-b85c1f46cddb
Diffstat (limited to 'EssentialsGeoIP/src/com/earth2me/essentials')
-rw-r--r--EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java b/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java
index d2b431a6b..0037da209 100644
--- a/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java
+++ b/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java
@@ -18,6 +18,7 @@ import java.net.URLConnection;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.zip.GZIPInputStream;
+import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerListener;
@@ -72,11 +73,17 @@ public class EssentialsGeoIPPlayerListener extends PlayerListener implements ICo
}
if (config.getBoolean("show-on-whois", true))
{
- User.get(event.getPlayer()).setMetadata("location", sb.toString());
+ u.setMetadata("location", sb.toString());
}
if (config.getBoolean("show-on-login", true))
{
- event.getPlayer().getServer().broadcastMessage("Player " + event.getPlayer().getDisplayName() + " comes from " + sb.toString());
+ for (Player player : event.getPlayer().getServer().getOnlinePlayers())
+ {
+ User user = User.get(player);
+ if (user.isAuthorized("essentials.geoip.show")) {
+ user.sendMessage("Player " + u.getDisplayName() + " comes from " + sb.toString());
+ }
+ }
}
}