Browse Source

daily auto reboot

lakebane-master
FatBoy-DOTC 10 months ago
parent
commit
1ae1deabdc
  1. 13
      src/engine/server/world/WorldServer.java

13
src/engine/server/world/WorldServer.java

@ -210,13 +210,7 @@ public class WorldServer {
this.isRunning = true; this.isRunning = true;
while (true) { while (true) {
if (LocalDateTime.now().isAfter(nextHeartbeatTime)) { if(LocalDateTime.now().getHour() == 21 && LocalDateTime.now().getMinute() == 48){
SERVERHEARTBEAT.tick();
nextHeartbeatTime = LocalDateTime.now().plusNanos(50000000);
}
LocalDateTime currentTime = LocalDateTime.now();
if(currentTime.getHour() == 2 && currentTime.getMinute() == 0){
//daily reboot //daily reboot
try { try {
Runtime rt = Runtime.getRuntime(); 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)) { if (LocalDateTime.now().isAfter(nextPopulationFileTime)) {
writePopulationFile(); writePopulationFile();
nextPopulationFileTime = LocalDateTime.now().plusMinutes(1); nextPopulationFileTime = LocalDateTime.now().plusMinutes(1);

Loading…
Cancel
Save