From 09f1abfe18258807c412bce88ad459984add0cd3 Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Tue, 9 Jun 2020 20:51:44 +0200 Subject: Add an rcon shutdown method --- server.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'server.h') diff --git a/server.h b/server.h index cb4fd76..43c5b9e 100644 --- a/server.h +++ b/server.h @@ -9,6 +9,7 @@ enum server_type { enum server_stop_method { SERVER_STOP_METHOD_UNDEFINED, + SERVER_STOP_METHOD_RCON, SERVER_STOP_METHOD_EXEC }; @@ -25,6 +26,7 @@ struct server { struct list_head locals; struct list_head remotes; struct list_head proxys; + struct list_head rcons; bool running; enum server_stop_method stop_method; @@ -36,6 +38,10 @@ struct server { char buf[4096]; size_t len; + /* For rcon connections */ + struct rcon *rcon; + char *rcon_password; + /* For announce messages */ struct iovec mcast_iov; struct msghdr mcast_msg; @@ -63,10 +69,16 @@ bool server_stop(struct cfg *cfg, struct server *scfg); bool server_commit(struct cfg *cfg, struct server *scfg); bool server_add_remote(struct cfg *cfg, struct server *scfg, - struct sockaddr_in46 *remote); + struct sockaddr_in46 *addr); bool server_add_local(struct cfg *cfg, struct server *scfg, - struct sockaddr_in46 *local); + struct sockaddr_in46 *addr); + +bool server_add_rcon(struct cfg *cfg, struct server *scfg, + struct sockaddr_in46 *addr); + +bool server_set_rcon_password(struct cfg *cfg, struct server *scfg, + const char *password); bool server_set_stop_method(struct cfg *cfg, struct server *scfg, enum server_stop_method stop_method); -- cgit v1.2.3