summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--EssentialsGroupManager/src/Changelog.txt4
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java10
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java4
3 files changed, 14 insertions, 4 deletions
diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt
index 077ea9163..4ea195a5d 100644
--- a/EssentialsGroupManager/src/Changelog.txt
+++ b/EssentialsGroupManager/src/Changelog.txt
@@ -201,4 +201,6 @@ v 2.0:
- Remove info node support from GlobalGroups. It should not have them as GlobalGroups are only permission collections.
- Change order of data in Users.yml to [name, Group, SubGroup, Permissions, Info nodes].
- Add alphabetically sorted user lists.
- - allWorldsDataList now returns fully mirrored worlds which are not identical mirrors (fixes the /manselect list). \ No newline at end of file
+ - allWorldsDataList now returns fully mirrored worlds which are not identical mirrors (fixes the /manselect list).
+ - Add support for Rcon.
+ - Prevent GM commands from being used on CommandBlocks. \ No newline at end of file
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
index 3daea93eb..fe7808238 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
@@ -34,9 +34,11 @@ import org.anjocaido.groupmanager.utils.Tasks;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.OfflinePlayer;
+import org.bukkit.command.BlockCommandSender;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
+import org.bukkit.command.RemoteConsoleCommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.ServicePriority;
@@ -380,6 +382,12 @@ public class GroupManager extends JavaPlugin {
Group senderGroup = null;
User senderUser = null;
boolean isOpOverride = config.isOpOverride();
+
+ // PREVENT GM COMMANDS BEING USED ON COMMANDBLOCKS
+ if (sender instanceof BlockCommandSender) {
+ sender.sendMessage(ChatColor.RED + "GM Commands can not be called from CommandBlocks");
+ return true;
+ }
if (sender.getClass().getName().equals("org.bukkit.craftbukkit.command.CraftBlockCommandSender")) {
sender.sendMessage(ChatColor.RED + "GM Commands can not be called from CommandBlocks");
@@ -403,7 +411,7 @@ public class GroupManager extends JavaPlugin {
if (isOpOverride || worldsHolder.getWorldPermissions(senderPlayer).has(senderPlayer, "groupmanager." + cmd.getName())) {
playerCanDo = true;
}
- } else if (sender instanceof ConsoleCommandSender) {
+ } else if ((sender instanceof ConsoleCommandSender) || (sender instanceof RemoteConsoleCommandSender)) {
if (!lastError.isEmpty() && !commandLabel.equalsIgnoreCase("manload")) {
sender.sendMessage(ChatColor.RED + "All commands are locked due to an error." + ChatColor.BOLD + "" + ChatColor.UNDERLINE + "Check the log" + ChatColor.RESET + " and then try a '/manload'.");
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java
index 92fec7737..12a6a5150 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java
@@ -204,10 +204,10 @@ public class WorldsHolder {
mirroredWorlds.add((String)key);
} else
- GroupManager.logger.log(Level.WARNING, "Mirroring error with " + (String)key + ". Recursive loop detected!");
+ throw new IllegalStateException("Unknown mirroring format for " + (String)key);
} else {
- throw new IllegalStateException("Unknown mirroring format for " + (String)key);
+ GroupManager.logger.log(Level.WARNING, "Mirroring error with " + (String)key + ". Recursive loop detected!");
}
}