From 231feef7feda80bfa39dc3a3516d1acf42152445 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Tue, 11 Jun 2024 21:05:50 -0500 Subject: [PATCH] mines open during a reboot time frame now open correctly --- src/engine/workthreads/HalfHourlyJobThread.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/engine/workthreads/HalfHourlyJobThread.java b/src/engine/workthreads/HalfHourlyJobThread.java index b26d3690..8b878e26 100644 --- a/src/engine/workthreads/HalfHourlyJobThread.java +++ b/src/engine/workthreads/HalfHourlyJobThread.java @@ -43,7 +43,14 @@ public class HalfHourlyJobThread implements Runnable { for (Mine mine : mines) { try { - // Open Mines owned by nations having their WOO + //handle mines opening on server reboot weird time interval + if(LocalDateTime.now().isAfter(LocalDateTime.now().withHour(mine.openHour).withMinute(mine.openMinute))) { + if (LocalDateTime.now().isBefore(LocalDateTime.now().withHour(mine.openHour).withMinute(mine.openMinute).plusMinutes(30))) { + HalfHourlyJobThread.mineWindowOpen(mine); + continue; + } + } + // set to the current mine window. if (mine.openHour == LocalDateTime.now().getHour() && mine.openMinute == LocalDateTime.now().getMinute() && !mine.wasClaimed) {