restricted-commands have been removed from config.yml

Now we have a whitelist: player-commands
This commit is contained in:
snowleo 2011-07-16 04:05:43 +02:00
parent a8fdce257b
commit d9b88a83d1
4 changed files with 49 additions and 45 deletions

View File

@ -30,7 +30,8 @@ public class ConfigPermissionsHandler implements IPermissionsHandler
public boolean hasPermission(final Player base, final String node) public boolean hasPermission(final Player base, final String node)
{ {
final String[] cmds = node.split("\\.", 2); final String[] cmds = node.split("\\.", 2);
return !ess.getSettings().isCommandRestricted(cmds[cmds.length - 1]); return !ess.getSettings().isCommandRestricted(cmds[cmds.length - 1])
&& ess.getSettings().isPlayerCommand(cmds[cmds.length - 1]);
} }
public String getPrefix(final Player base) public String getPrefix(final Player base)

View File

@ -126,4 +126,6 @@ public interface ISettings extends IConf
boolean removeGodOnDisconnect(); boolean removeGodOnDisconnect();
boolean changeDisplayName(); boolean changeDisplayName();
boolean isPlayerCommand(String string);
} }

View File

@ -101,6 +101,17 @@ public class Settings implements ISettings
return config.getBoolean("restrict-" + label.toLowerCase(), false); return config.getBoolean("restrict-" + label.toLowerCase(), false);
} }
@Override
public boolean isPlayerCommand(String label)
{
for (String c : config.getStringList("player-commands", new ArrayList<String>(0)))
{
if (!c.equalsIgnoreCase(label)) continue;
return true;
}
return false;
}
@Override @Override
public boolean isCommandOverridden(String name) public boolean isCommandOverridden(String name)
{ {

View File

@ -114,52 +114,42 @@ overridden-commands:
disabled-commands: disabled-commands:
# - nick # - nick
# Restricted commands will only be available to ops. # Restricted commands have been removed.
# Now we have a whitelist, all commands not on this list are only available to ops.
# These will have NO EFFECT if you have Permissions installed! # These will have NO EFFECT if you have Permissions installed!
# These are here only if you want something simpler than Permissions. # These are here only if you want something simpler than Permissions.
restricted-commands: player-commands:
- bigtree - afk
- item - back
- give - back.ondeath
- heal - balance
- plugin - clearinventory
- time - compass
- top - help
- tp - helpop
- tphere - home
- tree - home.others
- setspawn - ignore
- antioch - info
- kick - list
- ban - mail
- unban - motd
- top - msg
- jump - nick
- tpo - pay
- tppos - powertool
- tpohere - r
- economy - rules
- setwarp - seen
- delwarp - sell
- essentials - sethome
- gc - suicide
- spawnmob - tpa
- broadcast - tpaccept
- burn - tpahere
- ext - tpdeny
- kill - world
- ping - worth
- banip
- unban
- mute
- kick
- kickall
- unbanip
- togglejail
- setjail
- eco.loan
- teleport.timer.bypass
- teleport.cooldown.bypass
# Note: All items MUST be followed by a quantity! # Note: All items MUST be followed by a quantity!
# Times are measured in seconds. # Times are measured in seconds.