mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-01-28 02:11:22 +01:00
Clear lag spikes if system time ran backwards.
This commit is contained in:
parent
6256703d01
commit
b492bd5ac0
@ -7,6 +7,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.command.defaults.ClearCommand;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import fr.neatmonster.nocheatplus.NoCheatPlus;
|
import fr.neatmonster.nocheatplus.NoCheatPlus;
|
||||||
@ -362,9 +363,12 @@ public class TickTask implements Runnable {
|
|||||||
|
|
||||||
// Time running backwards check (not only players can!).
|
// Time running backwards check (not only players can!).
|
||||||
if (timeLast > time) {
|
if (timeLast > time) {
|
||||||
lastDur = 50;
|
|
||||||
LogUtil.logSevere("[NoCheatPlus] System time ran backwards (" + timeLast + "->" + time + "), clear all data and history...");
|
LogUtil.logSevere("[NoCheatPlus] System time ran backwards (" + timeLast + "->" + time + "), clear all data and history...");
|
||||||
DataManager.clearData(CheckType.ALL);
|
DataManager.clearData(CheckType.ALL);
|
||||||
|
lastDur = 50;
|
||||||
|
for (int i = 0; i < spikeDurations.length; i++){
|
||||||
|
spikes[i].clear(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (tick > 1){
|
else if (tick > 1){
|
||||||
lastDur = time - timeLast;
|
lastDur = time - timeLast;
|
||||||
|
Loading…
Reference in New Issue
Block a user