Browse Source

set maintenance dates correctly

lakebane-new
FatBoy-DOTC 5 months ago
parent
commit
e9fef85b72
  1. 2
      src/engine/gameManager/MaintenanceManager.java
  2. 4
      src/engine/workthreads/HourlyJobThread.java

2
src/engine/gameManager/MaintenanceManager.java

@ -24,7 +24,7 @@ public enum MaintenanceManager {
public static void setMaintDateTime(Building building, LocalDateTime maintDate) { public static void setMaintDateTime(Building building, LocalDateTime maintDate) {
building.maintDateTime = maintDate; building.maintDateTime = maintDate.withHour(1).withMinute(0).withSecond(0);
DbManager.BuildingQueries.updateMaintDate(building); DbManager.BuildingQueries.updateMaintDate(building);
} }

4
src/engine/workthreads/HourlyJobThread.java

@ -53,8 +53,8 @@ public class HourlyJobThread implements Runnable {
Logger.error("missing city map"); Logger.error("missing city map");
} }
//run maintenance every day at 1 am //run maintenance every day at 2 am
if(LocalDateTime.now().getHour() == 1) { if(LocalDateTime.now().getHour() == 2) {
MaintenanceManager.dailyMaintenance(); MaintenanceManager.dailyMaintenance();
//produce mine resources once a day //produce mine resources once a day

Loading…
Cancel
Save