diff --git a/qw/include/server.h b/qw/include/server.h index f0d03d2f4..24b1b3a8b 100644 --- a/qw/include/server.h +++ b/qw/include/server.h @@ -432,7 +432,6 @@ extern struct cvar_s *fraglimit; extern struct cvar_s *timelimit; extern server_static_t svs; // persistant server info -extern struct info_s **svs_info; extern server_t sv; // local server extern client_t *host_client; diff --git a/qw/source/cl_sys_sdl.c b/qw/source/cl_sys_sdl.c index 4e7cf833d..0d3361405 100644 --- a/qw/source/cl_sys_sdl.c +++ b/qw/source/cl_sys_sdl.c @@ -69,7 +69,6 @@ static __attribute__ ((used)) const char rcsid[] = #include "host.h" qboolean is_server = false; -char *svs_info; int noconinput; diff --git a/qw/source/cl_sys_unix.c b/qw/source/cl_sys_unix.c index 61109b5f9..492cd547e 100644 --- a/qw/source/cl_sys_unix.c +++ b/qw/source/cl_sys_unix.c @@ -62,7 +62,6 @@ static __attribute__ ((used)) const char rcsid[] = int noconinput = 0; qboolean is_server = false; -char *svs_info; static void shutdown (void) diff --git a/qw/source/cl_sys_win.c b/qw/source/cl_sys_win.c index af6e5ed7e..d33ba050f 100644 --- a/qw/source/cl_sys_win.c +++ b/qw/source/cl_sys_win.c @@ -63,8 +63,6 @@ static __attribute__ ((used)) const char rcsid[] = // minimization #define NOT_FOCUS_SLEEP 20 // sleep time when not focus -char *svs_info; - qboolean ActiveApp, Minimized, WinNT; qboolean is_server = false; diff --git a/qw/source/game.c b/qw/source/game.c index 5c7b824f3..83fed6d6a 100644 --- a/qw/source/game.c +++ b/qw/source/game.c @@ -77,10 +77,6 @@ SV_Gamedir_f (void) } QFS_Gamedir (dir); - - if (is_server) { - Info_SetValueForStarKey (*svs_info, "*gamedir", dir, 0); - } } void diff --git a/qw/source/sv_main.c b/qw/source/sv_main.c index 4f8b2a102..24ecfab57 100644 --- a/qw/source/sv_main.c +++ b/qw/source/sv_main.c @@ -2032,6 +2032,18 @@ maxclients_f (cvar_t *var) } } +static void +gamedir_f (int phase) +{ + if (!phase) + return; + if (qfs_gamedir->gamedir) + Info_SetValueForStarKey (svs.info, "*gamedir", + qfs_gamedir->gamedir, 0); + else + Info_RemoveKey (svs.info, "*gamedir"); +} + static void SV_InitLocal (void) { @@ -2522,6 +2534,7 @@ SV_Init (void) SV_Init_Memory (); + QFS_GamedirCallback (gamedir_f); svs.maxclients = MAX_CLIENTS; svs.info = Info_ParseString ("", MAX_SERVERINFO_STRING, 0); localinfo = Info_ParseString ("", 0, 0); // unlimited diff --git a/qw/source/sv_sys_unix.c b/qw/source/sv_sys_unix.c index deb4d2055..4ec7c8f66 100644 --- a/qw/source/sv_sys_unix.c +++ b/qw/source/sv_sys_unix.c @@ -61,7 +61,6 @@ static __attribute__ ((used)) const char rcsid[] = qboolean is_server = true; server_static_t svs; -info_t **svs_info = &svs.info; #ifdef __alpha__ static inline unsigned long diff --git a/qw/source/sv_sys_win.c b/qw/source/sv_sys_win.c index 98099c045..c3e234cae 100644 --- a/qw/source/sv_sys_win.c +++ b/qw/source/sv_sys_win.c @@ -46,8 +46,6 @@ static __attribute__ ((used)) const char rcsid[] = qboolean is_server = true; qboolean WinNT; server_static_t svs; -info_t **svs_info = &svs.info; - static void startup (void)