mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-01-15 12:01:51 +01:00
Account for server-side lag with burst packets.
Only count as burst, if there was enough lag. Might need adaption to count lag again for judging the EPM, due to differing window resolution.
This commit is contained in:
parent
b4ec7caa85
commit
901b2a45a2
@ -90,10 +90,14 @@ public class NetStatic {
|
||||
double violation = (double) fullCount - (double) (maxPackets * winNum * winDur / 1000f);
|
||||
final float burst = packetFreq.bucketScore(0);
|
||||
if (burst > burstPackets) {
|
||||
// TODO: Account for "just now lag", i.e. time until first occupied one > 0.
|
||||
// Account for server-side lag "minimally".
|
||||
if (burst > burstPackets * TickTask.getLag(winDur, true)) {
|
||||
// TODO: Does lag adaption suffice this way ?
|
||||
burstFreq.add(time, 1f); // TODO: Remove float packets or do this properly.
|
||||
violation = Math.max(violation, burst - burstDirect);
|
||||
violation = Math.max(violation, burstEPM * (double) (burstFreq.bucketDuration() * burstFreq.numberOfBuckets()) / 60000.0 - (double) burstFreq.score(0f));
|
||||
|
||||
}
|
||||
}
|
||||
return Math.max(0.0, violation);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user