From 64520b907329118024c114de4c5df8a7b2106fa7 Mon Sep 17 00:00:00 2001 From: L Date: Sun, 5 Feb 2023 01:41:45 +0100 Subject: [PATCH] Added GameSpy initialization and shutdown --- code/server/sv_init.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/code/server/sv_init.c b/code/server/sv_init.c index a9fd74c34..667a5859b 100644 --- a/code/server/sv_init.c +++ b/code/server/sv_init.c @@ -441,11 +441,28 @@ void SV_Startup( void ) { svs.initialized = qtrue; memset( last_mapname, 0, sizeof( last_mapname ) ); - // FIXME: use another master network ? - //SV_InitGamespy(); + SV_InitGamespy(); Cvar_Set( "sv_running", "1" ); } +/* +================== +SV_NumClients +================== +*/ +int SV_NumClients(void) { + int i; + int numClients = 0; + + for (i = 0; i < svs.iNumClients; i++) { + if (svs.clients[i].state > CS_FREE) { + ++numClients; + } + } + + return numClients; +} + /* ================== SV_ChangeMaxClients @@ -1062,6 +1079,7 @@ void SV_Shutdown( const char *finalmsg ) { } SV_RemoveOperatorCommands(); + SV_ShutdownGamespy(); SV_MasterShutdown(); SV_ShutdownGameProgs();