diff options
Diffstat (limited to 'server.h')
-rw-r--r-- | server.h | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -10,11 +10,13 @@ enum server_type { enum server_stop_method { SERVER_STOP_METHOD_UNDEFINED, SERVER_STOP_METHOD_RCON, + SERVER_STOP_METHOD_SYSTEMD, SERVER_STOP_METHOD_EXEC }; enum server_start_method { SERVER_START_METHOD_UNDEFINED, + SERVER_START_METHOD_SYSTEMD, SERVER_START_METHOD_EXEC }; @@ -31,12 +33,14 @@ struct server { enum server_stop_method stop_method; enum server_start_method start_method; + + /* For calling external start/stop executables */ char *stop_exec; char *start_exec; - /* For config files */ - char buf[4096]; - size_t len; + /* For systemd services */ + char *systemd_service; + char *systemd_obj; /* For rcon connections */ struct rcon *rcon; @@ -52,6 +56,10 @@ struct server { unsigned idle_timeout; unsigned idle_count; + /* For config files */ + char buf[4096]; + size_t len; + struct uring_task exec_task; struct uring_task task; struct list_head list; @@ -81,6 +89,9 @@ bool server_add_rcon(struct cfg *cfg, struct server *scfg, bool server_set_rcon_password(struct cfg *cfg, struct server *scfg, const char *password); +bool server_set_systemd_service(struct cfg *cfg, struct server *scfg, + const char *service); + bool server_set_stop_method(struct cfg *cfg, struct server *scfg, enum server_stop_method stop_method); |