Add a new dead process check by utilizing the game's listener port.
This commit is contained in:
parent
6574888344
commit
b098493b67
1 changed files with 15 additions and 0 deletions
|
@ -239,6 +239,7 @@ class StateMachine {
|
||||||
// Restart timers and such
|
// Restart timers and such
|
||||||
SessionData.timer.tickDown();
|
SessionData.timer.tickDown();
|
||||||
SessionData.operating_time.tickUp();
|
SessionData.operating_time.tickUp();
|
||||||
|
SessionData.timeSinceLastPing.tickUp();
|
||||||
SessionData.bumpModUpdateChecker();
|
SessionData.bumpModUpdateChecker();
|
||||||
|
|
||||||
// Check if we should send an alert
|
// Check if we should send an alert
|
||||||
|
@ -254,6 +255,20 @@ class StateMachine {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ping the server to check if it is alive
|
||||||
|
if (SessionData.timeSinceLastPing.getTotalSeconds() > 60 &&
|
||||||
|
SessionData.operating_time.getTotalSeconds() > (10 * 60)) {
|
||||||
|
SessionData.timeSinceLastPing.apply(0);
|
||||||
|
|
||||||
|
try {
|
||||||
|
Socket sock = await Socket.connect(
|
||||||
|
"127.0.0.1", settings.inst!.serverSettings.GamePort);
|
||||||
|
await sock.close();
|
||||||
|
} catch (E) {
|
||||||
|
DeadProcKillswitch.complete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (send && SessionData.enableRestartTimer) {
|
if (send && SessionData.enableRestartTimer) {
|
||||||
// Send the alert message
|
// Send the alert message
|
||||||
SessionData.CURRENT_INTERVAL = current;
|
SessionData.CURRENT_INTERVAL = current;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue