From 678e45ce6b4073b425f7081199182b5057dd3474 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Thu, 14 Mar 2024 19:20:25 -0500 Subject: [PATCH] 2am daily reboot --- src/engine/server/world/WorldServer.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/engine/server/world/WorldServer.java b/src/engine/server/world/WorldServer.java index 32c710b5..0b348715 100644 --- a/src/engine/server/world/WorldServer.java +++ b/src/engine/server/world/WorldServer.java @@ -196,7 +196,7 @@ public class WorldServer { } } - private int exec() { + private int exec() throws IOException { LocalDateTime nextHeartbeatTime = LocalDateTime.now(); LocalDateTime nextPopulationFileTime = LocalDateTime.now(); @@ -210,7 +210,12 @@ public class WorldServer { this.isRunning = true; while (true) { - + LocalDateTime currentTime = LocalDateTime.now(); + if(currentTime.getHour() == 2 && currentTime.getMinute() == 0){ + //daily reboot + Runtime rt = Runtime.getRuntime(); + rt.exec("./mbrestart.sh"); + } if (LocalDateTime.now().isAfter(nextHeartbeatTime)) { SERVERHEARTBEAT.tick(); nextHeartbeatTime = LocalDateTime.now().plusNanos(50000000);