mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-01-21 15:01:29 +01:00
Make penalty time more configurable for yawrate checking.
This commit is contained in:
parent
df22700a15
commit
979fd0a5e2
@ -83,7 +83,7 @@ public class Combined {
|
|||||||
if (total > threshold){
|
if (total > threshold){
|
||||||
// Add time
|
// Add time
|
||||||
final float amount = ((total - threshold) / threshold * 1000f);
|
final float amount = ((total - threshold) / threshold * 1000f);
|
||||||
data.timeFreeze = Math.max(data.timeFreeze, now + (long) amount);
|
data.timeFreeze = Math.max(data.timeFreeze, (long) Math.max(cc.yawRatePenaltyFactor * ((float) now + amount) , cc.yawRatePenaltyMin));
|
||||||
// TODO: balance (100 ... 200 ) ?
|
// TODO: balance (100 ... 200 ) ?
|
||||||
if (cc.yawRateImprobable && Improbable.check(player, amount / 100f, now))
|
if (cc.yawRateImprobable && Improbable.check(player, amount / 100f, now))
|
||||||
cancel = true;
|
cancel = true;
|
||||||
|
@ -58,8 +58,10 @@ public class CombinedConfig extends ACheckConfig {
|
|||||||
public final boolean invulnerableTriggerFallDistance;
|
public final boolean invulnerableTriggerFallDistance;
|
||||||
|
|
||||||
// Last yaw tracking
|
// Last yaw tracking
|
||||||
public final float yawRate;
|
public final float yawRate;
|
||||||
public final boolean yawRateImprobable;
|
public final boolean yawRateImprobable;
|
||||||
|
public final float yawRatePenaltyFactor;
|
||||||
|
public final int yawRatePenaltyMin;
|
||||||
|
|
||||||
public CombinedConfig(final ConfigFile config) {
|
public CombinedConfig(final ConfigFile config) {
|
||||||
improbableCheck = config.getBoolean(ConfPaths.COMBINED_IMPROBABLE_CHECK, false);
|
improbableCheck = config.getBoolean(ConfPaths.COMBINED_IMPROBABLE_CHECK, false);
|
||||||
@ -104,6 +106,8 @@ public class CombinedConfig extends ACheckConfig {
|
|||||||
invulnerableTriggerFallDistance = config.getBoolean(ConfPaths.COMBINED_INVULNERABLE_TRIGGERS_FALLDISTANCE);
|
invulnerableTriggerFallDistance = config.getBoolean(ConfPaths.COMBINED_INVULNERABLE_TRIGGERS_FALLDISTANCE);
|
||||||
yawRate = config.getInt(ConfPaths.COMBINED_YAWRATE_RATE);
|
yawRate = config.getInt(ConfPaths.COMBINED_YAWRATE_RATE);
|
||||||
yawRateImprobable = config.getBoolean(ConfPaths.COMBINED_YAWRATE_IMPROBABLE);
|
yawRateImprobable = config.getBoolean(ConfPaths.COMBINED_YAWRATE_IMPROBABLE);
|
||||||
|
yawRatePenaltyFactor = (float) config.getDouble(ConfPaths.COMBINED_YAWRATE_PENALTY_FACTOR);
|
||||||
|
yawRatePenaltyMin = config.getInt(ConfPaths.COMBINED_YAWRATE_PENALTY_MIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -318,6 +318,9 @@ public abstract class ConfPaths {
|
|||||||
private static final String COMBINED_YAWRATE = COMBINED + "yawrate.";
|
private static final String COMBINED_YAWRATE = COMBINED + "yawrate.";
|
||||||
public static final String COMBINED_YAWRATE_RATE = COMBINED_YAWRATE + "rate";
|
public static final String COMBINED_YAWRATE_RATE = COMBINED_YAWRATE + "rate";
|
||||||
public static final String COMBINED_YAWRATE_IMPROBABLE = COMBINED_YAWRATE + "improbable";
|
public static final String COMBINED_YAWRATE_IMPROBABLE = COMBINED_YAWRATE + "improbable";
|
||||||
|
private static final String COMBINED_YAWRATE_PENALTY = COMBINED_YAWRATE + "penalty.";
|
||||||
|
public static final String COMBINED_YAWRATE_PENALTY_FACTOR = COMBINED_YAWRATE_PENALTY + "factor";
|
||||||
|
public static final String COMBINED_YAWRATE_PENALTY_MIN = COMBINED_YAWRATE_PENALTY + "minimum";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 888'Y88 ,e, 888 d8
|
* 888'Y88 ,e, 888 d8
|
||||||
|
@ -242,6 +242,8 @@ public class DefaultConfig extends ConfigFile {
|
|||||||
set(ConfPaths.COMBINED_INVULNERABLE_MODIFIERS + ".all", 0);
|
set(ConfPaths.COMBINED_INVULNERABLE_MODIFIERS + ".all", 0);
|
||||||
|
|
||||||
set(ConfPaths.COMBINED_YAWRATE_RATE , 380);
|
set(ConfPaths.COMBINED_YAWRATE_RATE , 380);
|
||||||
|
set(ConfPaths.COMBINED_YAWRATE_PENALTY_FACTOR, 1.0);
|
||||||
|
set(ConfPaths.COMBINED_YAWRATE_PENALTY_MIN, 250);
|
||||||
set(ConfPaths.COMBINED_YAWRATE_IMPROBABLE, true);
|
set(ConfPaths.COMBINED_YAWRATE_IMPROBABLE, true);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user