Headless Server: auto-quit when empty, for cloud setups

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Post Reply
User avatar
Lizzy
Long Handed Inserter
Long Handed Inserter
Posts: 59
Joined: Sun May 28, 2017 4:26 am
Contact:

Headless Server: auto-quit when empty, for cloud setups

Post by Lizzy »

TL;DR
Create a configuration to automatically close the server when there are no players (after some sane waiting).

What ?
A while ago, I wrote a Python script that will track the number of players in the server and shuts it down after a wait if no one comes back. There is a much longer grace period at startup, too.

That worked okay, but now I'm revisiting this entire project as my friends and I are coming back to the game… and considering my Discord integration wasn't very useful because we just met same time every week, I feel like I can simplify my entire Python code away… except for that player tracker.

So I come here to ask, maybe add something like that to server-settings.json?

I would suggest:
"automatically_quit_server_when_empty": bool,
"autoquit_startup_grace_minutes": float,
"autoquit_drain_grace_minutes": float,

(This is surprisingly difficult to search, so sorry if this is a dupe, I really tried!)
Why ?
On cloud setups I can write a simple bash scripts that starts the server, and then backs up the saves and terminates when the game quits. Very practical!

Post Reply

Return to “Ideas and Suggestions”