From 1a66a5806744557eb590b9faf22a921a3d10a667 Mon Sep 17 00:00:00 2001 From: cloudwalk Date: Wed, 15 Jul 2020 02:44:18 +0000 Subject: [PATCH] host: Shutdown client-only subsystems in CL_Shutdown. This fixes an issue where darkplaces_history.txt was being generated on dedicated servers but wasn't actually being used. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12812 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_main.c | 23 +++++++++++++++++++++++ host.c | 26 ++------------------------ 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/cl_main.c b/cl_main.c index 3424e67c..7dc196eb 100644 --- a/cl_main.c +++ b/cl_main.c @@ -2705,11 +2705,34 @@ CL_Shutdown */ void CL_Shutdown (void) { + // be quiet while shutting down + S_StopAllSounds(); + + // disconnect client from server if active + CL_Disconnect(); + + CL_Video_Shutdown(); + +#ifdef CONFIG_MENU + // Shutdown menu + if(MR_Shutdown) + MR_Shutdown(); +#endif + + CDAudio_Shutdown (); + S_Terminate (); + + R_Modules_Shutdown(); + VID_Shutdown(); + CL_Screen_Shutdown(); CL_Particles_Shutdown(); CL_Parse_Shutdown(); CL_MeshEntities_Shutdown(); + Key_Shutdown(); + S_Shutdown(); + Mem_FreePool (&cls.permanentmempool); Mem_FreePool (&cls.levelmempool); } diff --git a/host.c b/host.c index 53e27fb7..55bd6fec 100644 --- a/host.c +++ b/host.c @@ -1113,58 +1113,36 @@ void Host_Shutdown(void) } isdown = true; - // be quiet while shutting down - S_StopAllSounds(); + if(cls.state != ca_dedicated) + CL_Shutdown(); // end the server thread if (svs.threaded) SV_StopThread(); - // disconnect client from server if active - CL_Disconnect(); - // shut down local server if active SV_LockThreadMutex(); SV_Shutdown (); SV_UnlockThreadMutex(); -#ifdef CONFIG_MENU - // Shutdown menu - if(MR_Shutdown) - MR_Shutdown(); -#endif - // AK shutdown PRVM // AK hmm, no PRVM_Shutdown(); yet - CL_Video_Shutdown(); - Host_SaveConfig(); - CDAudio_Shutdown (); - S_Terminate (); Curl_Shutdown (); NetConn_Shutdown (); - if (cls.state != ca_dedicated) - { - R_Modules_Shutdown(); - VID_Shutdown(); - } - SV_StopThread(); TaskQueue_Shutdown(); Thread_Shutdown(); Cmd_Shutdown(); - Key_Shutdown(); - CL_Shutdown(); Sys_Shutdown(); Log_Close(); Crypto_Shutdown(); Host_UnlockSession(); - S_Shutdown(); Con_Shutdown(); Memory_Shutdown(); } -- 2.39.2