Updated simulation metrics access.

This commit is contained in:
2023-03-16 12:18:42 -04:00
parent 3dbdad2580
commit a4029fb6e2
3 changed files with 22 additions and 17 deletions
+9
View File
@@ -15,6 +15,9 @@ import engine.server.MBServerStatics;
import engine.util.ThreadUtils;
import org.pmw.tinylog.Logger;
import java.time.Duration;
import java.time.Instant;
public class MobileFSMManager {
@@ -23,6 +26,8 @@ public class MobileFSMManager {
private volatile boolean alive;
private long timeOfKill = -1;
public static Duration executionTime;
private MobileFSMManager() {
Runnable worker = new Runnable() {
@@ -67,6 +72,7 @@ public class MobileFSMManager {
//Load zone threshold once.
long mobPulse = System.currentTimeMillis() + MBServerStatics.AI_PULSE_MOB_THRESHOLD;
Instant startTime;
while (alive) {
@@ -74,6 +80,8 @@ public class MobileFSMManager {
if (System.currentTimeMillis() > mobPulse) {
startTime = Instant.now();
for (Zone zone : ZoneManager.getAllZones()) {
for (Mob mob : zone.zoneMobSet) {
@@ -88,6 +96,7 @@ public class MobileFSMManager {
}
}
this.executionTime = Duration.between(startTime, Instant.now());
mobPulse = System.currentTimeMillis() + MBServerStatics.AI_PULSE_MOB_THRESHOLD;
}
}