mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-11-11 23:54:52 +09:00
Pause server ups when no players online (#405)
This commit is contained in:
1 parent
8bcb65101b
commit
d85f69b9cb
1 file changed
+8
@@ -24,6 +24,14 @@ export class InstancePlugin extends BaseInstancePlugin {
|
||||
}
|
||||
}
|
||||
|
||||
async onPlayerEvent(event: lib.PlayerEvent): Promise<void> {
|
||||
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;
|
||||
|
||||
Reference in new issue
Block a user