Really only run the check if it is enabled.

This commit is contained in:
Evenprime 2012-02-19 00:26:51 +01:00
parent c902b5d249
commit 3e5bdfac18
2 changed files with 3 additions and 3 deletions

View File

@ -76,9 +76,8 @@ public class ChatCheckListener implements Listener, EventManager {
data.botcheckpassed = true;
} else {
data.botcheckpassed = false;
spambotCheck.startTestForProxies(event.getPlayer(), event.getPlayer().getAddress().getAddress().getHostAddress());
}
spambotCheck.startTestForProxies(event.getPlayer(), event.getPlayer().getAddress().getAddress().getHostAddress());
}
public List<String> getActiveChecks(ConfigurationCacheStore cc) {

View File

@ -9,6 +9,7 @@ import cc.co.evenprime.bukkit.dnsbl.ProxyServerChecker;
import cc.co.evenprime.bukkit.nocheat.NoCheat;
import cc.co.evenprime.bukkit.nocheat.NoCheatPlayer;
import cc.co.evenprime.bukkit.nocheat.actions.ParameterName;
import cc.co.evenprime.bukkit.nocheat.config.Permissions;
/**
* The actual spam check is done at "SpamCheck". This will only
@ -38,7 +39,7 @@ public class SpambotTest extends ChatCheck implements ProxyServerCheckResultHand
boolean cancelled = false;
if(failures.size() > 0) {
if(failures.size() > 0 && config.spambotCheck && !player.hasPermission(Permissions.CHAT_SPAM_BOT)) {
data.spamBotFailed = new LinkedList<String>(failures);
// cancelled means the player stays in "spambot" status
cancelled = executeActions(ncplayer, config.spambotActions.getActions(failures.size()));