From c512071f2d987787ea073b6c5639f4e664bde5a4 Mon Sep 17 00:00:00 2001 From: myT Date: Mon, 29 Jan 2018 20:28:37 +0100 Subject: [PATCH] updating the FS on client disconnects --- changelog.txt | 2 ++ code/client/cl_main.cpp | 6 ++++++ code/qcommon/files.cpp | 7 ++----- code/server/sv_init.cpp | 4 ++-- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/changelog.txt b/changelog.txt index da0db33..39f716c 100644 --- a/changelog.txt +++ b/changelog.txt @@ -21,6 +21,8 @@ chg: on Windows, a fatal error will move the early console window to the foregro chg: com_hunkMegs doesn't have a maximum value anymore a value too high would reset it and the engine might fail to load with the default value +fix: now updating the FS (connected to pure server, pak references) on client disconnects + fix: the condump command was truncating its file path argument to 64 characters fix: "timedemo" playback runs at full speed again diff --git a/code/client/cl_main.cpp b/code/client/cl_main.cpp index 16be5f1..4343742 100644 --- a/code/client/cl_main.cpp +++ b/code/client/cl_main.cpp @@ -783,6 +783,12 @@ void CL_Disconnect( qbool showMainMenu ) { // not connected to a pure server anymore cl_connectedToPureServer = qfalse; + // let the FS know we're not connected to a pure server + // and clear all pak references except to the game QVM + FS_PureServerSetLoadedPaks( "" ); + FS_PureServerSetReferencedPaks( "", "" ); + FS_ClearPakReferences( FS_CGAME_REF | FS_UI_REF | FS_GENERAL_REF ); + // Stop recording any video if( CL_VideoRecording( ) ) { CL_CloseAVI( ); diff --git a/code/qcommon/files.cpp b/code/qcommon/files.cpp index 7485be7..2799c85 100644 --- a/code/qcommon/files.cpp +++ b/code/qcommon/files.cpp @@ -2892,9 +2892,6 @@ FS_ClearPakReferences void FS_ClearPakReferences( int flags ) { searchpath_t *search; - if ( !flags ) { - flags = -1; - } for ( search = fs_searchpaths; search; search = search->next ) { // is the element a pak file and has it been referenced? if ( search->pack ) { @@ -3039,8 +3036,8 @@ void FS_Restart( int checksumFeed ) { // set the checksum feed fs_checksumFeed = checksumFeed; - // clear pak references - FS_ClearPakReferences(0); + // clear all pak references + FS_ClearPakReferences(-1); // try to start up normally FS_Startup( BASEGAME ); diff --git a/code/server/sv_init.cpp b/code/server/sv_init.cpp index 9f2bade..84a88b7 100644 --- a/code/server/sv_init.cpp +++ b/code/server/sv_init.cpp @@ -355,8 +355,8 @@ void SV_SpawnServer( const char* mapname ) } } - // clear pak references - FS_ClearPakReferences(0); + // clear all pak references + FS_ClearPakReferences(-1); // allocate the snapshot entities on the hunk svs.snapshotEntities = (entityState_t*)Hunk_Alloc( sizeof(entityState_t)*svs.numSnapshotEntities, h_high );