daily auto reboot

This commit is contained in:
2024-03-14 20:48:38 -05:00
parent 54b7bcf907
commit 1ae1deabdc
+6 -7
View File
@@ -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);