From db0c440d1c20c96ae0e9b827c849e10ebf906fa9 Mon Sep 17 00:00:00 2001
From: Thayol
Date: Fri, 11 Jun 2021 19:01:43 +0200
Subject: [PATCH] Added a shutdown timer
---
unalike.py | 1 +
updater.js | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/unalike.py b/unalike.py
index 7789b31..c729f77 100644
--- a/unalike.py
+++ b/unalike.py
@@ -723,6 +723,7 @@ while running:
temp_output["apiPlayer"] = api_player
temp_output["roundsPlayed"] = global_rounds_played
temp_output["timestamp"] = math.floor(time.time())
+ temp_output["shutdownTimer"] = math.floor(global_shutdown_timer - current_shutdown_timer)
temp_output["boot"] = boot_timestamp
temp_output["delay"] = global_irc_send_timeout
temp_output["maxLobbies"] = global_max_lobbies
diff --git a/updater.js b/updater.js
index cafc61d..a2a0be7 100644
--- a/updater.js
+++ b/updater.js
@@ -132,6 +132,10 @@ function updateUnalikeDisplay(unalikeJson) {
if (unalikeJson.delay) {
newStatus += "
Current delay: " + unalikeJson.delay + " seconds between commands. (~" + unalikeJson.delay*4 + " seconds to create a lobby.)";
}
+
+ if (unalikeJson.shutdownTimer) {
+ newStatus += "
If nothing happens, Unalike will shut down in " + unalikeJson.shutdownTimer + " seconds.";
+ }
// dynamicJsonElement = document.getElementById("dynamic-json");
// dynamicJsonElement.innerHTML = JSON.stringify(unalikeJson);