mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-11-02 08:40:01 +01:00
Fix nopwnage VL accumulating wrongly. Add nopwnage.debug flag.
This commit is contained in:
parent
d4103899a5
commit
ad849d8273
@ -82,6 +82,7 @@ public class ChatConfig implements CheckConfig {
|
||||
public final ActionList globalChatActions;
|
||||
|
||||
public final boolean noPwnageCheck;
|
||||
public final boolean noPwnageDebug;
|
||||
public final int noPwnageLevel;
|
||||
public final float noPwnageVLFactor;
|
||||
|
||||
@ -159,6 +160,7 @@ public class ChatConfig implements CheckConfig {
|
||||
globalChatActions = config.getActionList(ConfPaths.CHAT_GLOBALCHAT_ACTIONS, Permissions.CHAT_GLOBALCHAT);
|
||||
|
||||
noPwnageCheck = config.getBoolean(ConfPaths.CHAT_NOPWNAGE_CHECK);
|
||||
noPwnageDebug = config.getBoolean(ConfPaths.CHAT_NOPWNAGE_DEBUG, false);
|
||||
noPwnageLevel = config.getInt(ConfPaths.CHAT_NOPWNAGE_LEVEL);
|
||||
// VL decreasing factor, hidden option.
|
||||
noPwnageVLFactor = (float) config.getDouble(ConfPaths.CHAT_NOPWNAGE_VL_FACTOR, 0.95);
|
||||
|
@ -208,7 +208,7 @@ public class NoPwnage extends Check implements ICaptcha{
|
||||
data.noPwnageVL.add(now, (float) (suspicion / 10D));
|
||||
|
||||
// Find out if we need to kick the player or not.
|
||||
cancel = executeActionsThreadSafe(player, cc.noPwnageVLFactor, suspicion / 10D, cc.noPwnageActions,
|
||||
cancel = executeActionsThreadSafe(player, data.noPwnageVL.getScore(cc.noPwnageVLFactor), suspicion / 10D, cc.noPwnageActions,
|
||||
isMainThread);
|
||||
}
|
||||
// else
|
||||
@ -221,6 +221,11 @@ public class NoPwnage extends Check implements ICaptcha{
|
||||
lastGlobalMessage = message;
|
||||
lastGlobalMessageTime = now;
|
||||
|
||||
if (cc.noPwnageDebug){
|
||||
final String msg = "[NoCheatPlus][nopwnage] Message ("+player.getName()+"/"+message.length()+"): suspicion="+suspicion +", vl="+CheckUtils.fdec3.format(data.noPwnageVL.getScore(cc.noPwnageVLFactor));
|
||||
CheckUtils.scheduleOutput(msg);
|
||||
}
|
||||
|
||||
return cancel;
|
||||
}
|
||||
|
||||
|
@ -176,6 +176,7 @@ public abstract class ConfPaths {
|
||||
// nopwnage
|
||||
private static final String CHAT_NOPWNAGE = CHAT + "nopwnage.";
|
||||
public static final String CHAT_NOPWNAGE_CHECK = CHAT_NOPWNAGE + "active";
|
||||
public static final String CHAT_NOPWNAGE_DEBUG = CHAT_NOPWNAGE + "debug";
|
||||
public static final String CHAT_NOPWNAGE_EXCLUSIONS = CHAT_NOPWNAGE + "exclusions";
|
||||
public static final String CHAT_NOPWNAGE_LEVEL = CHAT_NOPWNAGE + "level";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user