From b69a16bcf0abac1ebd2ca3d35520cfcb5b433e88 Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 16 Apr 2012 16:51:29 +1000 Subject: Remove EssentialsAntiCheat pending the release of a better alternative in 2.0 by @neatmonster --- .../anticheat/checks/chat/ChatConfig.java | 64 ---------------------- 1 file changed, 64 deletions(-) delete mode 100644 EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/checks/chat/ChatConfig.java (limited to 'EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/checks/chat/ChatConfig.java') 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 strings = new LinkedList(); - 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()]); - } -} -- cgit v1.2.3