diff options
author | KHobbits <rob@khobbits.co.uk> | 2012-12-16 12:12:23 +0000 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2012-12-16 12:12:23 +0000 |
commit | 8b4273cbd1e94a1c86cabccbcd978a782ae1ab59 (patch) | |
tree | 661648d6f19c9077704c960cae7741196564bf72 /EssentialsGroupManager/src | |
parent | 13efadbb65d3d3aa13b6a6827ba4a61127b48e34 (diff) | |
parent | 1151f1a29c15527eb5867b5d4fac7203bb244772 (diff) | |
download | Essentials-8b4273cbd1e94a1c86cabccbcd978a782ae1ab59.tar Essentials-8b4273cbd1e94a1c86cabccbcd978a782ae1ab59.tar.gz Essentials-8b4273cbd1e94a1c86cabccbcd978a782ae1ab59.tar.lz Essentials-8b4273cbd1e94a1c86cabccbcd978a782ae1ab59.tar.xz Essentials-8b4273cbd1e94a1c86cabccbcd978a782ae1ab59.zip |
Merge branch 'groupmanager' of github.com:essentials/Essentials into 2.9
Diffstat (limited to 'EssentialsGroupManager/src')
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!"); } } |