summary refs log tree commit diff homepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Config.ts1
-rw-r--r--src/MinecraftHandler.ts10
2 files changed, 11 insertions, 0 deletions
diff --git a/src/Config.ts b/src/Config.ts
index acbab21..5a1417d 100644
--- a/src/Config.ts
+++ b/src/Config.ts
@@ -37,6 +37,7 @@ export interface Config {
 
   SERVER_NAME: string
   SERVER_IMAGE: string
+  SHOW_SERVER_STATUS: boolean
   SHOW_PLAYER_CONN_STAT: boolean
   SHOW_PLAYER_ADVANCEMENT: boolean
   SHOW_PLAYER_DEATH: boolean
diff --git a/src/MinecraftHandler.ts b/src/MinecraftHandler.ts
index 7a81718..d9d30d6 100644
--- a/src/MinecraftHandler.ts
+++ b/src/MinecraftHandler.ts
@@ -88,6 +88,16 @@ class MinecraftHandler {
       }
 
       return { username: serverUsername, message: logLine }
+    } else if (this.config.SHOW_SERVER_STATUS && (logLine.includes('Starting minecraft server'))) {
+        if (this.config.DEBUG) {
+            console.log('[DEBUG]: Server has started')
+        }
+        return { username: serverUsername, message: "Server is online" }
+    } else if (this.config.SHOW_SERVER_STATUS && (logLine.includes('Stopping the server'))) {
+        if (this.config.DEBUG) {
+            console.log('[DEBUG]: Server has stopped')
+        }
+        return { username: serverUsername, message: "Server is offline" }
     } else if (this.config.SHOW_PLAYER_ADVANCEMENT && logLine.includes('made the advancement')) {
       // handle advancements
       if (this.config.DEBUG){