From 1ae1deabdcfad703eec41d7a1ddd2a789222edcd Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Thu, 14 Mar 2024 20:48:38 -0500 Subject: [PATCH] daily auto reboot --- src/engine/server/world/WorldServer.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/engine/server/world/WorldServer.java b/src/engine/server/world/WorldServer.java index a859e3f5..652b7004 100644 --- a/src/engine/server/world/WorldServer.java +++ b/src/engine/server/world/WorldServer.java @@ -210,13 +210,7 @@ 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){ + if(LocalDateTime.now().getHour() == 21 && LocalDateTime.now().getMinute() == 48){ //daily reboot try { Runtime rt = Runtime.getRuntime(); @@ -226,6 +220,11 @@ public class WorldServer { } } + if (LocalDateTime.now().isAfter(nextHeartbeatTime)) { + SERVERHEARTBEAT.tick(); + nextHeartbeatTime = LocalDateTime.now().plusNanos(50000000); + } + if (LocalDateTime.now().isAfter(nextPopulationFileTime)) { writePopulationFile(); nextPopulationFileTime = LocalDateTime.now().plusMinutes(1);