mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-09-05 03:31:09 +02: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