diff options
author | md_5 <md_5@bigpond.com> | 2012-04-16 16:51:29 +1000 |
---|---|---|
committer | md_5 <md_5@bigpond.com> | 2012-04-16 16:51:29 +1000 |
commit | b69a16bcf0abac1ebd2ca3d35520cfcb5b433e88 (patch) | |
tree | f3b1422bd2b34010a507ffc40990e3114c4e05f6 /EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/config | |
parent | 3ac78236787344b6a7e7d5be232488b46b8b26eb (diff) | |
download | Essentials-b69a16bcf0abac1ebd2ca3d35520cfcb5b433e88.tar Essentials-b69a16bcf0abac1ebd2ca3d35520cfcb5b433e88.tar.gz Essentials-b69a16bcf0abac1ebd2ca3d35520cfcb5b433e88.tar.lz Essentials-b69a16bcf0abac1ebd2ca3d35520cfcb5b433e88.tar.xz Essentials-b69a16bcf0abac1ebd2ca3d35520cfcb5b433e88.zip |
Remove EssentialsAntiCheat pending the release of a better alternative in 2.0 by @neatmonster
Diffstat (limited to 'EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/config')
7 files changed, 0 insertions, 688 deletions
diff --git a/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/config/ActionFactory.java b/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/config/ActionFactory.java deleted file mode 100644 index 5e07661c1..000000000 --- a/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/config/ActionFactory.java +++ /dev/null @@ -1,183 +0,0 @@ -package com.earth2me.essentials.anticheat.config; - -import com.earth2me.essentials.anticheat.actions.Action; -import com.earth2me.essentials.anticheat.actions.types.*; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - - -/** - * Helps with creating Actions out of text string definitions - * - */ -public class ActionFactory -{ - private static final Map<String, Object> lib = new HashMap<String, Object>(); - - public ActionFactory(Map<String, Object> library) - { - lib.putAll(library); - } - - public Action createAction(String actionDefinition) - { - - actionDefinition = actionDefinition.toLowerCase(); - - if (actionDefinition.equals("cancel")) - { - return new SpecialAction(); - } - - if (actionDefinition.startsWith("log:")) - { - return parseLogAction(actionDefinition.split(":", 2)[1]); - } - - if (actionDefinition.startsWith("cmd:")) - { - return parseCmdAction(actionDefinition.split(":", 2)[1]); - } - - throw new IllegalArgumentException("NoCheat doesn't understand action '" + actionDefinition + "' at all"); - } - - private Action parseCmdAction(String definition) - { - String[] parts = definition.split(":"); - String name = parts[0]; - Object command = lib.get(parts[0]); - int delay = 0; - int repeat = 1; - - if (command == null) - { - throw new IllegalArgumentException("NoCheat doesn't know command '" + name + "'. Have you forgotten to define it?"); - } - - if (parts.length > 1) - { - try - { - delay = Integer.parseInt(parts[1]); - repeat = Integer.parseInt(parts[2]); - } - catch (Exception e) - { - // TODO - System.out.println("NoCheat couldn't parse details of command '" + definition + "', will use default values instead."); - delay = 0; - repeat = 1; - } - } - - return new ConsolecommandAction(name, delay, repeat, command.toString()); - } - - private Action parseLogAction(String definition) - { - String[] parts = definition.split(":"); - String name = parts[0]; - Object message = lib.get(parts[0]); - int delay = 0; - int repeat = 1; - boolean toConsole = true; - boolean toFile = true; - boolean toChat = true; - - if (message == null) - { - throw new IllegalArgumentException("NoCheat doesn't know log message '" + name + "'. Have you forgotten to define it?"); - } - - try - { - delay = Integer.parseInt(parts[1]); - repeat = Integer.parseInt(parts[2]); - toConsole = parts[3].contains("c"); - toChat = parts[3].contains("i"); - toFile = parts[3].contains("f"); - } - catch (Exception e) - { - System.out.println("NoCheat couldn't parse details of log action '" + definition + "', will use default values instead."); - e.printStackTrace(); - delay = 0; - repeat = 1; - toConsole = true; - toFile = true; - toChat = true; - } - - return new LogAction(name, delay, repeat, toChat, toConsole, toFile, message.toString()); - } - - public Action[] createActions(String... definitions) - { - List<Action> actions = new ArrayList<Action>(); - - for (String def : definitions) - { - if (def.length() == 0) - { - continue; - } - try - { - actions.add(createAction(def)); - } - catch (IllegalArgumentException e) - { - System.out.println(e.getMessage()); - actions.add(new DummyAction(def)); - } - } - - return actions.toArray(new Action[actions.size()]); - } - - public ActionList createActionList(String definition, String permission) - { - ActionList list = new ActionList(permission); - - boolean first = true; - - for (String s : definition.split("vl>")) - { - s = s.trim(); - - if (s.length() == 0) - { - first = false; - continue; - } - - try - { - Integer vl; - String def; - if (first) - { - first = false; - vl = 0; - def = s; - } - else - { - String[] listEntry = s.split("\\s+", 2); - vl = Integer.parseInt(listEntry[0]); - def = listEntry[1]; - } - list.setActions(vl, createActions(def.split("\\s+"))); - } - catch (Exception e) - { - System.out.println("NoCheat couldn't parse action definition 'vl:" + s + "'"); - } - } - - return list; - } -} diff --git a/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/config/ConfPaths.java b/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/config/ConfPaths.java deleted file mode 100644 index 9466b4105..000000000 --- a/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/config/ConfPaths.java +++ /dev/null @@ -1,147 +0,0 @@ -package com.earth2me.essentials.anticheat.config; - -/** - * Paths for the configuration options Making everything final static prevents accidentially modifying any of these - * - */ -public abstract class ConfPaths -{ - // TODO - private final static String LOGGING = "logging."; - public final static String LOGGING_ACTIVE = LOGGING + "active"; - public final static String LOGGING_PREFIX = LOGGING + "prefix"; - public final static String LOGGING_FILENAME = LOGGING + "filename"; - public final static String LOGGING_LOGTOFILE = LOGGING + "file"; - public final static String LOGGING_LOGTOCONSOLE = LOGGING + "console"; - public final static String LOGGING_LOGTOINGAMECHAT = LOGGING + "ingamechat"; - public final static String LOGGING_SHOWACTIVECHECKS = LOGGING + "showactivechecks"; - public final static String LOGGING_DEBUGMESSAGES = LOGGING + "debugmessages"; - public final static String DISABLE_MODS = "disableMods"; - - private final static String CHECKS = "checks."; - - private final static String INVENTORY = CHECKS + "inventory."; - - private final static String INVENTORY_DROP = INVENTORY + "drop."; - public final static String INVENTORY_DROP_CHECK = INVENTORY_DROP + "active"; - public final static String INVENTORY_DROP_TIMEFRAME = INVENTORY_DROP + "time"; - public final static String INVENTORY_DROP_LIMIT = INVENTORY_DROP + "limit"; - public final static String INVENTORY_DROP_ACTIONS = INVENTORY_DROP + "actions"; - - private static final String INVENTORY_INSTANTBOW = INVENTORY + "instantbow."; - public final static String INVENTORY_INSTANTBOW_CHECK = INVENTORY_INSTANTBOW + "active"; - public static final String INVENTORY_INSTANTBOW_ACTIONS = INVENTORY_INSTANTBOW + "actions"; - - private static final String INVENTORY_INSTANTEAT = INVENTORY + "instanteat."; - public final static String INVENTORY_INSTANTEAT_CHECK = INVENTORY_INSTANTEAT + "active"; - public static final String INVENTORY_INSTANTEAT_ACTIONS = INVENTORY_INSTANTEAT + "actions"; - - private final static String MOVING = CHECKS + "moving."; - - private final static String MOVING_RUNFLY = MOVING + "runfly."; - public final static String MOVING_RUNFLY_CHECK = MOVING_RUNFLY + "active"; - - // These four are not automatically shown in the config - public final static String MOVING_RUNFLY_WALKSPEED = MOVING_RUNFLY + "walkspeed"; - public final static String MOVING_RUNFLY_SNEAKSPEED = MOVING_RUNFLY + "sneakspeed"; - public final static String MOVING_RUNFLY_SWIMSPEED = MOVING_RUNFLY + "swimspeed"; - public final static String MOVING_RUNFLY_SPRINTSPEED = MOVING_RUNFLY + "sprintspeed"; - - public final static String MOVING_RUNFLY_ALLOWFASTSNEAKING = MOVING_RUNFLY + "allowfastsneaking"; - public final static String MOVING_RUNFLY_ACTIONS = MOVING_RUNFLY + "actions"; - - public final static String MOVING_RUNFLY_CHECKNOFALL = MOVING_RUNFLY + "checknofall"; - public final static String MOVING_RUNFLY_NOFALLAGGRESSIVE = MOVING_RUNFLY + "nofallaggressivemode"; - public final static String MOVING_RUNFLY_NOFALLACTIONS = MOVING_RUNFLY + "nofallactions"; - - private final static String MOVING_RUNFLY_FLYING = MOVING_RUNFLY + "flying."; - public final static String MOVING_RUNFLY_FLYING_ALLOWALWAYS = MOVING_RUNFLY_FLYING + "allowflyingalways"; - public final static String MOVING_RUNFLY_FLYING_ALLOWINCREATIVE = MOVING_RUNFLY_FLYING + "allowflyingincreative"; - public final static String MOVING_RUNFLY_FLYING_SPEEDLIMITVERTICAL = MOVING_RUNFLY_FLYING + "flyingspeedlimitvertical"; - public final static String MOVING_RUNFLY_FLYING_SPEEDLIMITHORIZONTAL = MOVING_RUNFLY_FLYING + "flyingspeedlimithorizontal"; - public final static String MOVING_RUNFLY_FLYING_HEIGHTLIMIT = MOVING_RUNFLY_FLYING + "flyingheightlimit"; - public final static String MOVING_RUNFLY_FLYING_ACTIONS = MOVING_RUNFLY_FLYING + "actions"; - - private final static String MOVING_MOREPACKETS = MOVING + "morepackets."; - public final static String MOVING_MOREPACKETS_CHECK = MOVING_MOREPACKETS + "active"; - public final static String MOVING_MOREPACKETS_ACTIONS = MOVING_MOREPACKETS + "actions"; - - private final static String BLOCKBREAK = CHECKS + "blockbreak."; - - private final static String BLOCKBREAK_REACH = BLOCKBREAK + "reach."; - public final static String BLOCKBREAK_REACH_CHECK = BLOCKBREAK_REACH + "active"; - public final static String BLOCKBREAK_REACH_ACTIONS = BLOCKBREAK_REACH + "actions"; - - private final static String BLOCKBREAK_DIRECTION = BLOCKBREAK + "direction."; - public final static String BLOCKBREAK_DIRECTION_CHECK = BLOCKBREAK_DIRECTION + "active"; - public final static String BLOCKBREAK_DIRECTION_PRECISION = BLOCKBREAK_DIRECTION + "precision"; - public final static String BLOCKBREAK_DIRECTION_PENALTYTIME = BLOCKBREAK_DIRECTION + "penaltytime"; - public final static String BLOCKBREAK_DIRECTION_ACTIONS = BLOCKBREAK_DIRECTION + "actions"; - - private final static String BLOCKBREAK_NOSWING = BLOCKBREAK + "noswing."; - public static final String BLOCKBREAK_NOSWING_CHECK = BLOCKBREAK_NOSWING + "active"; - public static final String BLOCKBREAK_NOSWING_ACTIONS = BLOCKBREAK_NOSWING + "actions"; - - private final static String BLOCKPLACE = CHECKS + "blockplace."; - - public final static String BLOCKPLACE_SPEED = BLOCKPLACE + "speed."; - public final static String BLOCKPLACE_SPEED_CHECK = BLOCKPLACE_SPEED + "active"; - public final static String BLOCKPLACE_SPEED_ACTIONS = BLOCKPLACE_SPEED + "actions"; - public final static String BLOCKPLACE_SPEED_TIME = BLOCKPLACE_SPEED + "speed"; - private final static String BLOCKPLACE_REACH = BLOCKPLACE + "reach."; - public final static String BLOCKPLACE_REACH_CHECK = BLOCKPLACE_REACH + "active"; - public final static String BLOCKPLACE_REACH_ACTIONS = BLOCKPLACE_REACH + "actions"; - - private final static String BLOCKPLACE_DIRECTION = BLOCKPLACE + "direction."; - public final static String BLOCKPLACE_DIRECTION_CHECK = BLOCKPLACE_DIRECTION + "active"; - public final static String BLOCKPLACE_DIRECTION_PRECISION = BLOCKPLACE_DIRECTION + "precision"; - public final static String BLOCKPLACE_DIRECTION_PENALTYTIME = BLOCKPLACE_DIRECTION + "penaltytime"; - public final static String BLOCKPLACE_DIRECTION_ACTIONS = BLOCKPLACE_DIRECTION + "actions"; - - private final static String CHAT = CHECKS + "chat."; - - private final static String CHAT_COLOR = CHAT + "color."; - public final static String CHAT_COLOR_CHECK = CHAT_COLOR + "active"; - public final static String CHAT_COLOR_ACTIONS = CHAT_COLOR + "actions"; - - private final static String CHAT_SPAM = CHAT + "spam."; - public final static String CHAT_SPAM_CHECK = CHAT_SPAM + "active"; - public final static String CHAT_SPAM_WHITELIST = CHAT_SPAM + "whitelist"; - public final static String CHAT_SPAM_TIMEFRAME = CHAT_SPAM + "timeframe"; - public final static String CHAT_SPAM_MESSAGELIMIT = CHAT_SPAM + "messagelimit"; - public final static String CHAT_SPAM_COMMANDLIMIT = CHAT_SPAM + "commandlimit"; - public final static String CHAT_SPAM_ACTIONS = CHAT_SPAM + "actions"; - - private final static String FIGHT = CHECKS + "fight."; - - private final static String FIGHT_DIRECTION = FIGHT + "direction."; - public final static String FIGHT_DIRECTION_CHECK = FIGHT_DIRECTION + "active"; - public final static String FIGHT_DIRECTION_PRECISION = FIGHT_DIRECTION + "precision"; - public final static String FIGHT_DIRECTION_PENALTYTIME = FIGHT_DIRECTION + "penaltytime"; - public final static String FIGHT_DIRECTION_ACTIONS = FIGHT_DIRECTION + "actions"; - - private final static String FIGHT_NOSWING = FIGHT + "noswing."; - public final static String FIGHT_NOSWING_CHECK = FIGHT_NOSWING + "active"; - public final static String FIGHT_NOSWING_ACTIONS = FIGHT_NOSWING + "actions"; - - private final static String FIGHT_REACH = FIGHT + "reach."; - public static final String FIGHT_REACH_CHECK = FIGHT_REACH + "active"; - public static final String FIGHT_REACH_LIMIT = FIGHT_REACH + "distance"; - public static final String FIGHT_REACH_PENALTYTIME = FIGHT_REACH + "penaltytime"; - public static final String FIGHT_REACH_ACTIONS = FIGHT_REACH + "actions"; - - private final static String FIGHT_SPEED = FIGHT + "speed."; - public final static String FIGHT_SPEED_CHECK = FIGHT_SPEED + "active"; - public final static String FIGHT_SPEED_ATTACKLIMIT = FIGHT_SPEED + "attacklimit"; - public final static String FIGHT_SPEED_ACTIONS = FIGHT_SPEED + "actions"; - - private final static String FIGHT_GODMODE = FIGHT + "godmode."; - public static final String FIGHT_GODMODE_CHECK = FIGHT_GODMODE + "active"; - public final static String FIGHT_GODMODE_ACTIONS = FIGHT_GODMODE + "actions"; - - private final static String FIGHT_INSTANTHEAL = FIGHT + "instantheal."; - public static final String FIGHT_INSTANTHEAL_CHECK = FIGHT_INSTANTHEAL + "active"; - public final static String FIGHT_INSTANTHEAL_ACTIONS = FIGHT_INSTANTHEAL + "actions"; - - public final static String STRINGS = "strings"; -} diff --git a/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/config/ConfigurationCacheStore.java b/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/config/ConfigurationCacheStore.java deleted file mode 100644 index fa404d5ea..000000000 --- a/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/config/ConfigurationCacheStore.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.earth2me.essentials.anticheat.config; - -import com.earth2me.essentials.anticheat.ConfigItem; -import java.util.HashMap; -import java.util.Map; - - -/** - * A class to keep all configurables of the plugin associated with a world - * - */ -public class ConfigurationCacheStore -{ - public final LoggingConfig logging; - private final Map<String, ConfigItem> configMap = new HashMap<String, ConfigItem>(); - private final NoCheatConfiguration data; - - /** - * Instantiate a config cache and populate it with the data of a Config tree (and its parent tree) - */ - public ConfigurationCacheStore(NoCheatConfiguration data) - { - - logging = new LoggingConfig(data); - - this.data = data; - } - - @SuppressWarnings("unchecked") - public <T extends ConfigItem> T get(String id) - { - return (T)configMap.get(id); - } - - public void set(String id, ConfigItem config) - { - - configMap.put(id, config); - } - - public NoCheatConfiguration getConfiguration() - { - return this.data; - } -} diff --git a/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/config/ConfigurationManager.java b/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/config/ConfigurationManager.java deleted file mode 100644 index 039254889..000000000 --- a/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/config/ConfigurationManager.java +++ /dev/null @@ -1,151 +0,0 @@ -package com.earth2me.essentials.anticheat.config; - -import com.earth2me.essentials.anticheat.NoCheat; -import java.io.File; -import java.io.PrintWriter; -import java.io.StringWriter; -import java.text.SimpleDateFormat; -import java.util.logging.*; -import org.bukkit.configuration.file.FileConfiguration; - - -/** - * Central location for everything that's described in the configuration file(s) - * - */ -public class ConfigurationManager -{ - private FileHandler fileHandler; - private ConfigurationCacheStore cache; - private final NoCheat plugin; - - - private static class LogFileFormatter extends Formatter - { - private final SimpleDateFormat date; - - public LogFileFormatter() - { - date = new SimpleDateFormat("yy.MM.dd HH:mm:ss"); - } - - @Override - public String format(LogRecord record) - { - StringBuilder builder = new StringBuilder(); - Throwable ex = record.getThrown(); - - builder.append(date.format(record.getMillis())); - builder.append(" ["); - builder.append(record.getLevel().getLocalizedName().toUpperCase()); - builder.append("] "); - builder.append(record.getMessage()); - builder.append('\n'); - - if (ex != null) - { - StringWriter writer = new StringWriter(); - ex.printStackTrace(new PrintWriter(writer)); - builder.append(writer); - } - - return builder.toString(); - } - } - - public ConfigurationManager(NoCheat plugin, File rootConfigFolder) - { - this.plugin = plugin; - - // Setup the real configuration - initializeConfig(rootConfigFolder); - } - - /** - * Read the configuration file and assign either standard values or whatever is declared in the file - * - * @param configurationFile - */ - private void initializeConfig(File rootConfigFolder) - { - FileConfiguration conf = plugin.getConfig(); - conf.options().copyDefaults(true); - conf.options().copyHeader(true); - plugin.saveConfig(); - NoCheatConfiguration root = new NoCheatConfiguration(conf); - - root.regenerateActionLists(); - - // Create a corresponding Configuration Cache - // put the global config on the config map - cache = new ConfigurationCacheStore(root); - - plugin.setFileLogger(setupFileLogger(new File(rootConfigFolder, root.getString(ConfPaths.LOGGING_FILENAME)))); - } - - private Logger setupFileLogger(File logfile) - { - - Logger l = Logger.getAnonymousLogger(); - l.setLevel(Level.INFO); - // Ignore parent's settings - l.setUseParentHandlers(false); - for (Handler h : l.getHandlers()) - { - l.removeHandler(h); - } - - if (fileHandler != null) - { - fileHandler.close(); - l.removeHandler(fileHandler); - fileHandler = null; - } - - try - { - try - { - logfile.getParentFile().mkdirs(); - } - catch (Exception e) - { - e.printStackTrace(); - } - fileHandler = new FileHandler(logfile.getCanonicalPath(), true); - fileHandler.setLevel(Level.ALL); - fileHandler.setFormatter(new LogFileFormatter()); - - l.addHandler(fileHandler); - } - catch (Exception e) - { - e.printStackTrace(); - } - - return l; - } - - /** - * Reset the loggers and flush and close the fileHandlers to be able to use them next time without problems - */ - public void cleanup() - { - fileHandler.flush(); - fileHandler.close(); - Logger l = Logger.getLogger("NoCheat"); - l.removeHandler(fileHandler); - fileHandler = null; - } - - /** - * Get the cache of the specified world, or the default cache, if no cache exists for that world. - * - * @param worldname - * @return - */ - public ConfigurationCacheStore getConfigurationCacheForWorld(String worldname) - { - return cache; - } -} diff --git a/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/config/LoggingConfig.java b/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/config/LoggingConfig.java deleted file mode 100644 index 9875c7715..000000000 --- a/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/config/LoggingConfig.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.earth2me.essentials.anticheat.config; - - -/** - * Configurations specific for logging. Every world gets one of these. - * - */ -public class LoggingConfig -{ - public final boolean active; - public final boolean showactivechecks; - public final boolean toFile; - public final boolean toConsole; - public final boolean toChat; - public final String prefix; - public final boolean debugmessages; - - public LoggingConfig(NoCheatConfiguration data) - { - - active = data.getBoolean(ConfPaths.LOGGING_ACTIVE); - showactivechecks = data.getBoolean(ConfPaths.LOGGING_SHOWACTIVECHECKS); - debugmessages = data.getBoolean(ConfPaths.LOGGING_DEBUGMESSAGES); - prefix = data.getString(ConfPaths.LOGGING_PREFIX); - toFile = data.getBoolean(ConfPaths.LOGGING_LOGTOFILE); - toConsole = data.getBoolean(ConfPaths.LOGGING_LOGTOCONSOLE); - toChat = data.getBoolean(ConfPaths.LOGGING_LOGTOINGAMECHAT); - } -} diff --git a/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/config/NoCheatConfiguration.java b/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/config/NoCheatConfiguration.java deleted file mode 100644 index 4172174c9..000000000 --- a/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/config/NoCheatConfiguration.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.earth2me.essentials.anticheat.config; - -import com.earth2me.essentials.anticheat.actions.Action; -import com.earth2me.essentials.anticheat.actions.types.ActionList; -import org.bukkit.configuration.file.FileConfiguration; - - -public class NoCheatConfiguration -{ - private ActionFactory factory; - private FileConfiguration conf; - - public NoCheatConfiguration(FileConfiguration conf) - { - this.conf = conf; - } - - /** - * Do this after reading new data - */ - public void regenerateActionLists() - { - factory = new ActionFactory(conf.getConfigurationSection(ConfPaths.STRINGS).getValues(false)); - } - - /** - * A convenience method to get action lists from the config - * - * @param path - * @return - */ - public ActionList getActionList(String path, String permission) - { - String value = conf.getString(path); - return factory.createActionList(value, permission); - } - - /** - * Savely store ActionLists back into the yml file - * - * @param path - * @param list - */ - public void set(String path, ActionList list) - { - StringBuilder string = new StringBuilder(); - - for (int treshold : list.getTresholds()) - { - if (treshold > 0) - { - string.append(" vl>").append(treshold); - } - for (Action action : list.getActions(treshold)) - { - string.append(" ").append(action); - } - } - - conf.set(path, string.toString().trim()); - } - - public int getInt(String path) - { - return conf.getInt(path); - } - - public int getInt(String path, int def) - { - return conf.getInt(path, def); - } - - public boolean getBoolean(String path) - { - return conf.getBoolean(path); - } - - public String getString(String path) - { - return conf.getString(path); - } -} diff --git a/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/config/Permissions.java b/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/config/Permissions.java deleted file mode 100644 index 1551f6f21..000000000 --- a/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/config/Permissions.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.earth2me.essentials.anticheat.config; - - -/** - * The various permission nodes used by NoCheat - * - */ -public class Permissions -{ - private static final String NOCHEAT = "nocheat"; - private static final String ADMIN = NOCHEAT + ".admin"; - private static final String CHECKS = NOCHEAT + ".checks"; - private static final String MOD = NOCHEAT + ".mod"; - public static final String MOVING = CHECKS + ".moving"; - public static final String MOVING_RUNFLY = MOVING + ".runfly"; - public static final String MOVING_SWIMMING = MOVING + ".swimming"; - public static final String MOVING_SNEAKING = MOVING + ".sneaking"; - public static final String MOVING_FLYING = MOVING + ".flying"; - public static final String MOVING_NOFALL = MOVING + ".nofall"; - public static final String MOVING_MOREPACKETS = MOVING + ".morepackets"; - public static final String BLOCKBREAK = CHECKS + ".blockbreak"; - public static final String BLOCKBREAK_REACH = BLOCKBREAK + ".reach"; - public static final String BLOCKBREAK_DIRECTION = BLOCKBREAK + ".direction"; - public static final String BLOCKBREAK_NOSWING = BLOCKBREAK + ".noswing"; - public static final String BLOCKPLACE = CHECKS + ".blockplace"; - public static final String BLOCKPLACE_REACH = BLOCKPLACE + ".reach"; - public static final String BLOCKPLACE_DIRECTION = BLOCKPLACE + ".direction"; - public static final String BLOCKPLACE_SPEED = BLOCKPLACE + ".speed"; - public static final String CHAT = CHECKS + ".chat"; - public static final String CHAT_SPAM = CHAT + ".spam"; - public static final String CHAT_COLOR = CHAT + ".color"; - public static final String FIGHT = CHECKS + ".fight"; - public static final String FIGHT_DIRECTION = FIGHT + ".direction"; - public static final String FIGHT_NOSWING = FIGHT + ".noswing"; - public static final String FIGHT_REACH = FIGHT + ".reach"; - public static final String FIGHT_SPEED = FIGHT + ".speed"; - public static final String FIGHT_GODMODE = FIGHT + ".godmode"; - public static final String FIGHT_INSTANTHEAL = FIGHT + ".instantheal"; - public static final String ADMIN_CHATLOG = ADMIN + ".chatlog"; - public static final String ADMIN_COMMANDS = ADMIN + ".commands"; - public static final String ADMIN_RELOAD = ADMIN + ".reload"; - public static final String INVENTORY = CHECKS + ".inventory"; - public static final String INVENTORY_DROP = INVENTORY + ".drop"; - public static final String INVENTORY_INSTANTBOW = INVENTORY + ".instantbow"; - public static final String INVENTORY_INSTANTEAT = INVENTORY + ".instanteat"; - public static final String ZOMBES_CHEAT = MOD + ".zombes.cheat"; - public static final String ZOMBES_FLY = MOD + ".zombes.fly"; - public static final String CJB_FLY = MOD + ".cjb.fly"; - public static final String CJB_XRAY = MOD + ".cjb.xray"; - public static final String CJB_MINIMAP = MOD + ".cjb.minimap"; -} |