summaryrefslogtreecommitdiffstats
path: root/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/checks/chat/ChatConfig.java
diff options
context:
space:
mode:
authorementalo <ementalodev@gmx.co.uk>2012-07-17 12:26:55 +0100
committerementalo <ementalodev@gmx.co.uk>2012-07-17 14:21:03 +0100
commita661bce7b3de3f53e2b7b79c1283f0affa6fe9c3 (patch)
tree2aa10b6300f6c8d3cb2b298c124180fade74857a /EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/checks/chat/ChatConfig.java
parent3c385e69271dfe8530fadc3f67e13ee495e4b0e1 (diff)
parent9f05e43ecf8e6e1a8fcaef757678e762f0d82573 (diff)
downloadEssentials-a661bce7b3de3f53e2b7b79c1283f0affa6fe9c3.tar
Essentials-a661bce7b3de3f53e2b7b79c1283f0affa6fe9c3.tar.gz
Essentials-a661bce7b3de3f53e2b7b79c1283f0affa6fe9c3.tar.lz
Essentials-a661bce7b3de3f53e2b7b79c1283f0affa6fe9c3.tar.xz
Essentials-a661bce7b3de3f53e2b7b79c1283f0affa6fe9c3.zip
Merge of server-layer branch
Diffstat (limited to 'EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/checks/chat/ChatConfig.java')
-rw-r--r--EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/checks/chat/ChatConfig.java64
1 files changed, 0 insertions, 64 deletions
diff --git a/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/checks/chat/ChatConfig.java b/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/checks/chat/ChatConfig.java
deleted file mode 100644
index 06ad5c9fc..000000000
--- a/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/checks/chat/ChatConfig.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package com.earth2me.essentials.anticheat.checks.chat;
-
-import java.util.LinkedList;
-import java.util.List;
-import com.earth2me.essentials.anticheat.ConfigItem;
-import com.earth2me.essentials.anticheat.actions.types.ActionList;
-import com.earth2me.essentials.anticheat.config.ConfPaths;
-import com.earth2me.essentials.anticheat.config.NoCheatConfiguration;
-import com.earth2me.essentials.anticheat.config.Permissions;
-
-
-/**
- * Configurations specific for the "Chat" checks Every world gets one of these assigned to it, or if a world doesn't get
- * it's own, it will use the "global" version
- *
- */
-public class ChatConfig implements ConfigItem
-{
- public final boolean spamCheck;
- public final String[] spamWhitelist;
- public final long spamTimeframe;
- public final int spamMessageLimit;
- public final int spamCommandLimit;
- public final ActionList spamActions;
- public final boolean colorCheck;
- public final ActionList colorActions;
-
- public ChatConfig(NoCheatConfiguration data)
- {
-
- spamCheck = data.getBoolean(ConfPaths.CHAT_SPAM_CHECK);
- spamWhitelist = splitWhitelist(data.getString(ConfPaths.CHAT_SPAM_WHITELIST));
- spamTimeframe = data.getInt(ConfPaths.CHAT_SPAM_TIMEFRAME) * 1000L;
- spamMessageLimit = data.getInt(ConfPaths.CHAT_SPAM_MESSAGELIMIT);
- spamCommandLimit = data.getInt(ConfPaths.CHAT_SPAM_COMMANDLIMIT);
- spamActions = data.getActionList(ConfPaths.CHAT_SPAM_ACTIONS, Permissions.CHAT_SPAM);
- colorCheck = data.getBoolean(ConfPaths.CHAT_COLOR_CHECK);
- colorActions = data.getActionList(ConfPaths.CHAT_COLOR_ACTIONS, Permissions.CHAT_COLOR);
- }
-
- /**
- * Convenience method to split a string into an array on every occurance of the "," character, removing all
- * whitespaces before and after it too.
- *
- * @param string The string containing text seperated by ","
- * @return An array of the seperate texts
- */
- private String[] splitWhitelist(String string)
- {
-
- List<String> strings = new LinkedList<String>();
- string = string.trim();
-
- for (String s : string.split(","))
- {
- if (s != null && s.trim().length() > 0)
- {
- strings.add(s.trim());
- }
- }
-
- return strings.toArray(new String[strings.size()]);
- }
-}