Visibility and comments.

This commit is contained in:
asofold 2012-12-05 21:51:57 +01:00
parent 79b514d4fa
commit 115adb342a

View File

@ -49,7 +49,7 @@ public class TickTask implements Runnable {
private static final Set<PermissionUpdateEntry> permissionUpdates = new LinkedHashSet<PermissionUpdateEntry>(50); private static final Set<PermissionUpdateEntry> permissionUpdates = new LinkedHashSet<PermissionUpdateEntry>(50);
/** Actions to execute. */ /** Actions to execute. */
public static final List<ViolationData> delayedActions = new LinkedList<ViolationData>(); private static final List<ViolationData> delayedActions = new LinkedList<ViolationData>();
/** Task id of the running TickTask */ /** Task id of the running TickTask */
protected static int taskId = -1; protected static int taskId = -1;
@ -216,13 +216,20 @@ public class TickTask implements Runnable {
public void run() { public void run() {
tick ++; tick ++;
final long time = System.currentTimeMillis(); final long time = System.currentTimeMillis();
// The isEmpty checks are faster than synchronizing fully always, the actions get delayed one tick at most.
// Now sync is forced, for the ability to lock.
executeActions(); executeActions();
updatePermissions(); updatePermissions();
// Time running backwards check (not only players can!).
if (timeLast > time) { if (timeLast > time) {
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);
} }
// TODO: Lag measurement !
// Finish.
timeLast = time; timeLast = time;
} }