From d917c50e3e5feb90bfef866f11c30a3569169d1f Mon Sep 17 00:00:00 2001 From: PHIDIAS Date: Sun, 31 Aug 2025 01:43:29 +0900 Subject: [PATCH] . --- exp_server_ups/instance.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/exp_server_ups/instance.ts b/exp_server_ups/instance.ts index 9cbe1e63..661c18bd 100644 --- a/exp_server_ups/instance.ts +++ b/exp_server_ups/instance.ts @@ -24,6 +24,14 @@ export class InstancePlugin extends BaseInstancePlugin { } } + async onPlayerEvent(event: lib.PlayerEvent): Promise { + if (event.type === "join" && !this.updateInterval) { + await this.onStart(); + } else if (event.type === "leave" && this.instance.playersOnline.size == 0 && this.instance.config.get("factorio.settings")["auto_pause"] as boolean) { + this.onExit(); + } + } + async updateUps() { let ups = 0; const collected = this.gameTimes.length - 1;