summaryrefslogtreecommitdiffstats
path: root/EssentialsChat/src/com
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-06-16 16:22:51 +0100
committerKHobbits <rob@khobbits.co.uk>2012-06-16 16:22:51 +0100
commit97eada7dd6ee2bb80babf25834101baa5bbc9a7b (patch)
treed89ac2d71b69e752ce85068649a10e55d7eb2873 /EssentialsChat/src/com
parenta764f8c929a8bf58c5a8d0fac6659b5ddbc554af (diff)
downloadEssentials-97eada7dd6ee2bb80babf25834101baa5bbc9a7b.tar
Essentials-97eada7dd6ee2bb80babf25834101baa5bbc9a7b.tar.gz
Essentials-97eada7dd6ee2bb80babf25834101baa5bbc9a7b.tar.lz
Essentials-97eada7dd6ee2bb80babf25834101baa5bbc9a7b.tar.xz
Essentials-97eada7dd6ee2bb80babf25834101baa5bbc9a7b.zip
Players should not be able to ignore Console
Also implement chat exempt permission in other commands.
Diffstat (limited to 'EssentialsChat/src/com')
-rw-r--r--EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java38
1 files changed, 20 insertions, 18 deletions
diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java
index c65eb5a0e..58b094793 100644
--- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java
+++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java
@@ -63,7 +63,7 @@ public abstract class EssentialsChatPlayer implements Listener
case '?':
return "question";
//case '@':
- //return "admin";
+ //return "admin";
default:
return "";
}
@@ -121,32 +121,34 @@ public abstract class EssentialsChatPlayer implements Listener
{
String type = _("chatTypeLocal");
final User onlineUser = ess.getUser(onlinePlayer);
- if (onlineUser.isIgnoredPlayer(sender.getName()) && !sender.isAuthorized("essentials.chat.ignoreexempt"))
+ if (onlineUser.isIgnoredPlayer(sender))
{
continue;
}
if (!onlineUser.equals(sender))
{
- boolean abort = false;
- final Location playerLoc = onlineUser.getLocation();
- if (playerLoc.getWorld() != world)
+ boolean abort = false;
+ final Location playerLoc = onlineUser.getLocation();
+ if (playerLoc.getWorld() != world)
+ {
+ abort = true;
+ }
+ final double delta = playerLoc.distanceSquared(loc);
+ if (delta > chatStore.getRadius())
+ {
+ abort = true;
+ }
+ if (abort)
+ {
+ if (onlineUser.isAuthorized("essentials.chat.spy"))
{
- abort = true;
+ type = type.concat(_("chatTypeSpy"));
}
- final double delta = playerLoc.distanceSquared(loc);
- if (delta > chatStore.getRadius())
+ else
{
- abort = true;
+ continue;
}
- if (abort) {
- if (onlineUser.isAuthorized("essentials.chat.spy"))
- {
- type = type.concat(_("chatTypeSpy"));
- }
- else
- {
- continue;
- }
+ }
}
String message = String.format(event.getFormat(), type.concat(sender.getDisplayName()), event.getMessage());