|
|
@ -196,7 +196,7 @@ public class WorldServer { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private int exec() { |
|
|
|
private int exec() throws IOException { |
|
|
|
|
|
|
|
|
|
|
|
LocalDateTime nextHeartbeatTime = LocalDateTime.now(); |
|
|
|
LocalDateTime nextHeartbeatTime = LocalDateTime.now(); |
|
|
|
LocalDateTime nextPopulationFileTime = LocalDateTime.now(); |
|
|
|
LocalDateTime nextPopulationFileTime = LocalDateTime.now(); |
|
|
@ -210,7 +210,12 @@ public class WorldServer { |
|
|
|
this.isRunning = true; |
|
|
|
this.isRunning = true; |
|
|
|
|
|
|
|
|
|
|
|
while (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)) { |
|
|
|
if (LocalDateTime.now().isAfter(nextHeartbeatTime)) { |
|
|
|
SERVERHEARTBEAT.tick(); |
|
|
|
SERVERHEARTBEAT.tick(); |
|
|
|
nextHeartbeatTime = LocalDateTime.now().plusNanos(50000000); |
|
|
|
nextHeartbeatTime = LocalDateTime.now().plusNanos(50000000); |
|
|
|