mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-01-13 19:11:22 +01:00
Accoutn for lag in chat.commands.
This commit is contained in:
parent
cce67ac67c
commit
6a70f0a010
@ -47,9 +47,15 @@ public class Commands extends Check {
|
||||
data.commandsShortTermWeight = 1.0;
|
||||
}
|
||||
else if (tick - data.commandsShortTermTick < cc.commandsShortTermTicks){
|
||||
// TODO: account for lag.
|
||||
// Add up.
|
||||
data.commandsShortTermWeight += weight;
|
||||
if (!cc.lag || TickTask.getLag(50L * (tick - data.commandsShortTermTick), true) < 1.3f){
|
||||
// Add up.
|
||||
data.commandsShortTermWeight += weight;
|
||||
}
|
||||
else{
|
||||
// Reset, too much lag.
|
||||
data.commandsShortTermTick = tick;
|
||||
data.commandsShortTermWeight = 1.0;
|
||||
}
|
||||
}
|
||||
else{
|
||||
// Reset.
|
||||
|
Loading…
Reference in New Issue
Block a user