mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-10-31 07:40:16 +01:00
[Bleeding] Account for server side lag in combined.improbable.
This commit is contained in:
parent
a32a428d08
commit
1b350af75f
@ -4,6 +4,7 @@ import org.bukkit.entity.Player;
|
||||
|
||||
import fr.neatmonster.nocheatplus.checks.Check;
|
||||
import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
import fr.neatmonster.nocheatplus.utilities.TickTask;
|
||||
|
||||
/**
|
||||
* This check combines different other checks frequency and occurrecnces into one count.
|
||||
@ -55,14 +56,20 @@ public class Improbable extends Check {
|
||||
double violation = 0;
|
||||
boolean violated = false;
|
||||
if (shortTerm * 0.8f > cc.improbableLevel / 20.0){
|
||||
violation += shortTerm * 2d;
|
||||
final float lag = cc.lag ? TickTask.getLag(data.improbableCount.bucketDuration(), true) : 1f;
|
||||
if (shortTerm / lag > cc.improbableLevel / 20.0){
|
||||
violation += shortTerm * 2d / lag;
|
||||
violated = true;
|
||||
}
|
||||
}
|
||||
final double full = data.improbableCount.score(1.0f);
|
||||
if (full > cc.improbableLevel){
|
||||
violation += full;
|
||||
final float lag = cc.lag ? TickTask.getLag(data.improbableCount.bucketDuration() * data.improbableCount.numberOfBuckets(), true) : 1f;
|
||||
if (full / lag > cc.improbableLevel){
|
||||
violation += full / lag;
|
||||
violated = true;
|
||||
}
|
||||
}
|
||||
boolean cancel = false;
|
||||
if (violated){
|
||||
// Execute actions
|
||||
|
Loading…
Reference in New Issue
Block a user