mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-12-30 20:37:52 +01:00
Add "grace" parameter to the FastBreak config to replace
buckets.contention. For compatibility buckets.contention is still read and the maximum of both is used.
This commit is contained in:
parent
b4302edc48
commit
34d6f2ff31
@ -79,7 +79,7 @@ public class BlockBreakConfig extends ACheckConfig {
|
|||||||
public final int fastBreakBuckets;
|
public final int fastBreakBuckets;
|
||||||
public final long fastBreakBucketDur;
|
public final long fastBreakBucketDur;
|
||||||
public final float fastBreakBucketFactor;
|
public final float fastBreakBucketFactor;
|
||||||
public final long fastBreakBucketContention;
|
public final long fastBreakGrace;
|
||||||
public final long fastBreakDelay;
|
public final long fastBreakDelay;
|
||||||
public final int fastBreakModSurvival;
|
public final int fastBreakModSurvival;
|
||||||
public final int fastBreakModCreative;
|
public final int fastBreakModCreative;
|
||||||
@ -125,7 +125,7 @@ public class BlockBreakConfig extends ACheckConfig {
|
|||||||
// Hidden settings of new check.
|
// Hidden settings of new check.
|
||||||
fastBreakDebug = data.getBoolean(ConfPaths.BLOCKBREAK_FASTBREAK_DEBUG, false);
|
fastBreakDebug = data.getBoolean(ConfPaths.BLOCKBREAK_FASTBREAK_DEBUG, false);
|
||||||
fastBreakDelay = data.getLong(ConfPaths.BLOCKBREAK_FASTBREAK_DELAY);
|
fastBreakDelay = data.getLong(ConfPaths.BLOCKBREAK_FASTBREAK_DELAY);
|
||||||
fastBreakBucketContention = data.getLong(ConfPaths.BLOCKBREAK_FASTBREAK_BUCKETS_CONTENTION, 2000);
|
fastBreakGrace = Math.max(data.getLong(ConfPaths.BLOCKBREAK_FASTBREAK_BUCKETS_CONTENTION, 2000), data.getLong(ConfPaths.BLOCKBREAK_FASTBREAK_GRACE));
|
||||||
fastBreakBucketDur = data.getInt(ConfPaths.BLOCKBREAK_FASTBREAK_BUCKETS_DUR, 4000);
|
fastBreakBucketDur = data.getInt(ConfPaths.BLOCKBREAK_FASTBREAK_BUCKETS_DUR, 4000);
|
||||||
fastBreakBucketFactor = (float) data.getDouble(ConfPaths.BLOCKBREAK_FASTBREAK_BUCKETS_FACTOR, 0.99);
|
fastBreakBucketFactor = (float) data.getDouble(ConfPaths.BLOCKBREAK_FASTBREAK_BUCKETS_FACTOR, 0.99);
|
||||||
fastBreakBuckets = data.getInt(ConfPaths.BLOCKBREAK_FASTBREAK_BUCKETS_N, 30);
|
fastBreakBuckets = data.getInt(ConfPaths.BLOCKBREAK_FASTBREAK_BUCKETS_N, 30);
|
||||||
|
@ -74,7 +74,7 @@ public class FastBreak extends Check {
|
|||||||
data.fastBreakPenalties.add(now, (float) missingTime);
|
data.fastBreakPenalties.add(now, (float) missingTime);
|
||||||
|
|
||||||
// Only raise a violation, if the total penalty score exceeds the contention duration (for lag, delay).
|
// Only raise a violation, if the total penalty score exceeds the contention duration (for lag, delay).
|
||||||
if (data.fastBreakPenalties.score(cc.fastBreakBucketFactor) > cc.fastBreakBucketContention){
|
if (data.fastBreakPenalties.score(cc.fastBreakBucketFactor) > cc.fastBreakGrace){
|
||||||
// TODO: maybe add one absolute penalty time for big amounts to stop breaking until then
|
// TODO: maybe add one absolute penalty time for big amounts to stop breaking until then
|
||||||
final double vlAdded = (double) missingTime / 1000.0;
|
final double vlAdded = (double) missingTime / 1000.0;
|
||||||
data.fastBreakVL += vlAdded;
|
data.fastBreakVL += vlAdded;
|
||||||
|
@ -88,6 +88,7 @@ public abstract class ConfPaths {
|
|||||||
public static final String BLOCKBREAK_FASTBREAK_BUCKETS_DUR = BLOCKBREAK_FASTBREAK_BUCKETS + "duration";
|
public static final String BLOCKBREAK_FASTBREAK_BUCKETS_DUR = BLOCKBREAK_FASTBREAK_BUCKETS + "duration";
|
||||||
public static final String BLOCKBREAK_FASTBREAK_BUCKETS_FACTOR = BLOCKBREAK_FASTBREAK_BUCKETS + "factor";
|
public static final String BLOCKBREAK_FASTBREAK_BUCKETS_FACTOR = BLOCKBREAK_FASTBREAK_BUCKETS + "factor";
|
||||||
public static final String BLOCKBREAK_FASTBREAK_DELAY = BLOCKBREAK_FASTBREAK + "delay";
|
public static final String BLOCKBREAK_FASTBREAK_DELAY = BLOCKBREAK_FASTBREAK + "delay";
|
||||||
|
public static final String BLOCKBREAK_FASTBREAK_GRACE = BLOCKBREAK_FASTBREAK + "grace";
|
||||||
public static final String BLOCKBREAK_FASTBREAK_MOD_CREATIVE = BLOCKBREAK_FASTBREAK + "intervalcreative";
|
public static final String BLOCKBREAK_FASTBREAK_MOD_CREATIVE = BLOCKBREAK_FASTBREAK + "intervalcreative";
|
||||||
public static final String BLOCKBREAK_FASTBREAK_MOD_SURVIVAL = BLOCKBREAK_FASTBREAK + "intervalsurvival";
|
public static final String BLOCKBREAK_FASTBREAK_MOD_SURVIVAL = BLOCKBREAK_FASTBREAK + "intervalsurvival";
|
||||||
public static final String BLOCKBREAK_FASTBREAK_ACTIONS = BLOCKBREAK_FASTBREAK + "actions";
|
public static final String BLOCKBREAK_FASTBREAK_ACTIONS = BLOCKBREAK_FASTBREAK + "actions";
|
||||||
|
@ -84,6 +84,7 @@ public class DefaultConfig extends ConfigFile {
|
|||||||
set(ConfPaths.BLOCKBREAK_FASTBREAK_CHECK, true);
|
set(ConfPaths.BLOCKBREAK_FASTBREAK_CHECK, true);
|
||||||
set(ConfPaths.BLOCKBREAK_FASTBREAK_DELAY, 90);
|
set(ConfPaths.BLOCKBREAK_FASTBREAK_DELAY, 90);
|
||||||
set(ConfPaths.BLOCKBREAK_FASTBREAK_MOD_SURVIVAL, 100);
|
set(ConfPaths.BLOCKBREAK_FASTBREAK_MOD_SURVIVAL, 100);
|
||||||
|
set(ConfPaths.BLOCKBREAK_FASTBREAK_GRACE, 2000);
|
||||||
set(ConfPaths.BLOCKBREAK_FASTBREAK_ACTIONS, "cancel vl>0 log:fastbreak:3:5:cif cancel");
|
set(ConfPaths.BLOCKBREAK_FASTBREAK_ACTIONS, "cancel vl>0 log:fastbreak:3:5:cif cancel");
|
||||||
|
|
||||||
set(ConfPaths.BLOCKBREAK_FREQUENCY_CHECK, true);
|
set(ConfPaths.BLOCKBREAK_FREQUENCY_CHECK, true);
|
||||||
|
Loading…
Reference in New Issue
Block a user