diff --git a/src/fr/neatmonster/nocheatplus/checks/chat/ChatData.java b/src/fr/neatmonster/nocheatplus/checks/chat/ChatData.java index 6965a284..2230fe7a 100644 --- a/src/fr/neatmonster/nocheatplus/checks/chat/ChatData.java +++ b/src/fr/neatmonster/nocheatplus/checks/chat/ChatData.java @@ -47,6 +47,7 @@ public class ChatData implements CheckData { } // Violation levels. + public double captchaVL; public double colorVL; public double noPwnageVL; @@ -68,6 +69,8 @@ public class ChatData implements CheckData { */ public synchronized void clearNoPwnageData() { noPwnageCaptchTries = noPwnageReloginWarnings = 0; + captchaVL = 0D; + // colorVL, noPwnageVL <- are spared to avoid problems with spam + captcha success. noPwnageJoinTime = noPwnageLastMessageTime = noPwnageLastMovedTime = noPwnageLastWarningTime = noPwnageLeaveTime = noPwnageReloginWarningTime = 0L; noPwnageGeneratedCaptcha = noPwnageLastMessage = ""; } diff --git a/src/fr/neatmonster/nocheatplus/checks/chat/NoPwnage.java b/src/fr/neatmonster/nocheatplus/checks/chat/NoPwnage.java index 4b27e2bb..12950919 100644 --- a/src/fr/neatmonster/nocheatplus/checks/chat/NoPwnage.java +++ b/src/fr/neatmonster/nocheatplus/checks/chat/NoPwnage.java @@ -171,12 +171,15 @@ public class NoPwnage extends Check { } else { // Increment his tries number counter. data.noPwnageCaptchTries++; - + data.captchaVL ++; // Does he failed too much times? if (data.noPwnageCaptchTries > cc.noPwnageCaptchaTries) { // Find out if we need to kick the player or not. - cancel = executeActionsThreadSafe(player, data.noPwnageCaptchTries, 1, cc.noPwnageCaptchaActions, + cancel = executeActionsThreadSafe(player, data.captchaVL, 1, cc.noPwnageCaptchaActions, isMainThread); + // reset in case of reconnection allowed. + if (!player.isOnline()) + data.noPwnageCaptchTries = 0; } // Display the question again (if not kicked). diff --git a/src/fr/neatmonster/nocheatplus/config/DefaultConfig.java b/src/fr/neatmonster/nocheatplus/config/DefaultConfig.java index de734982..79c495e8 100644 --- a/src/fr/neatmonster/nocheatplus/config/DefaultConfig.java +++ b/src/fr/neatmonster/nocheatplus/config/DefaultConfig.java @@ -141,7 +141,7 @@ public class DefaultConfig extends ConfigFile { "&cPlease type '&6[captcha]&c' to continue sending messages/commands."); set(ConfPaths.CHAT_NOPWNAGE_CAPTCHA_SUCCESS, "&aOK, it sounds like you're not a spambot."); set(ConfPaths.CHAT_NOPWNAGE_CAPTCHA_TRIES, 3); - set(ConfPaths.CHAT_NOPWNAGE_CAPTCHA_ACTIONS, "cancel cmd:kickcaptcha"); + set(ConfPaths.CHAT_NOPWNAGE_CAPTCHA_ACTIONS, "cancel cmd:kickcaptcha VL>4 cancel cmd:kickcaptcha log:captcha:2:5:icf"); set(ConfPaths.CHAT_NOPWNAGE_FIRST_CHECK, true); set(ConfPaths.CHAT_NOPWNAGE_FIRST_TIMEOUT, 3000L); @@ -305,6 +305,7 @@ public class DefaultConfig extends ConfigFile { set(ConfPaths.STRINGS + ".bpspeed", start + "tried to throw projectiles too quickly" + end); set(ConfPaths.STRINGS + ".breach", start + "tried to interact with a block over distance [reachdistance] block(s)" + end); + set(ConfPaths.STRINGS + ".captcha", "[player] failed captcha repeatedly" + end); set(ConfPaths.STRINGS + ".color", start + "sent colored chat message" + end); set(ConfPaths.STRINGS + ".critical", start + "tried to do a critical hit but wasn't technically jumping" + end); set(ConfPaths.STRINGS + ".drop", start + "tried to drop more items than allowed" + end);