From a8c768931e5e49cb000078119d071d1261f0a170 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Thu, 14 Mar 2024 19:21:21 -0500 Subject: [PATCH] 2am daily reboot --- src/engine/server/world/WorldServer.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/engine/server/world/WorldServer.java b/src/engine/server/world/WorldServer.java index 3dca8c97..a859e3f5 100644 --- a/src/engine/server/world/WorldServer.java +++ b/src/engine/server/world/WorldServer.java @@ -210,6 +210,11 @@ public class WorldServer { this.isRunning = true; while (true) { + if (LocalDateTime.now().isAfter(nextHeartbeatTime)) { + SERVERHEARTBEAT.tick(); + nextHeartbeatTime = LocalDateTime.now().plusNanos(50000000); + } + LocalDateTime currentTime = LocalDateTime.now(); if(currentTime.getHour() == 2 && currentTime.getMinute() == 0){ //daily reboot @@ -220,10 +225,6 @@ public class WorldServer { Logger.info(err.getMessage()); } } - if (LocalDateTime.now().isAfter(nextHeartbeatTime)) { - SERVERHEARTBEAT.tick(); - nextHeartbeatTime = LocalDateTime.now().plusNanos(50000000); - } if (LocalDateTime.now().isAfter(nextPopulationFileTime)) { writePopulationFile();