From d02633af4e780c4b6f6d938c67d84d2c968adb79 Mon Sep 17 00:00:00 2001 From: Andrey Nazarov Date: Sat, 11 Oct 2008 15:05:50 +0000 Subject: Major redesign of GTV protocol: added support for persistent GTV connections, bidirectional pinging, low traffic (`suspended') modes. HTTP server is now gone (remote console logging is temporary gone too), custom binary protocol is used for GTV connections now. MVD client no longer serves other MVD clients, only regular spectators. Changed FIFO buffers to be regular circular buffers, not BIP-buffers. Removed `sv_http_*', `sv_console_auth' variables. Added `sv_mvd_maxclients' variable, `addgtvhost', `delgtvhost' and `listgtvhosts' commands. Renamed `sv_mvd_max*' cvars for consistency. Reset `sv_ghostime' default value back to 6, but changed semantics: it now waits for any packet from client, not just `begin' packet. Added `--disable-mvd-server' and `--disable-mvd-client' options to configure script. FS_Restart() no longer chokes on real files opened for reading. Fixed client chat prompt length. Stubbed out more debugging stuff from dedicated server builds. --- source/files.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'source/files.c') diff --git a/source/files.c b/source/files.c index c297c9f..6289d52 100644 --- a/source/files.c +++ b/source/files.c @@ -474,15 +474,7 @@ void FS_FCloseFile( fileHandle_t f ) { break; } - // don't clear name and mode, in case - // this handle will be reopened later - file->type = FS_FREE; - file->fp = NULL; -#if USE_ZLIB - file->zfp = NULL; -#endif - file->pak = NULL; - file->unique = qfalse; + memset( file, 0, sizeof( *file ) ); } /* @@ -2516,12 +2508,16 @@ void FS_Restart( void ) { temp = com_logFile; com_logFile = 0; - // make sure no files are opened for reading + // make sure no files from paks are opened for( i = 0, file = fs_files; i < MAX_FILE_HANDLES; i++, file++ ) { - if( file->type == FS_FREE ) { - continue; - } - if( file->mode == FS_MODE_READ ) { + switch( file->type ) { + case FS_FREE: + case FS_REAL: +#if USE_ZLIB + case FS_GZIP: +#endif + break; + default: Com_Error( ERR_FATAL, "%s: closing handle %d", __func__, i + 1 ); } } -- cgit v1.2.3