diff options
author | Andrey Nazarov <skuller@skuller.net> | 2007-09-19 18:55:33 +0000 |
---|---|---|
committer | Andrey Nazarov <skuller@skuller.net> | 2007-09-19 18:55:33 +0000 |
commit | c1213b4bde16524ea07d6972c9312f8bc57d7b98 (patch) | |
tree | f9cb5e966eb70bd2b8b54d0f13a7b5a1cb2bef56 /source/files.c | |
parent | 044a1e4478e130aef267a60669baa0f22d92acf5 (diff) |
Made fs_restart command available for dedicated servers.
Do not reset CVAR_LATCHED flag in Cvar_Get, as it causes problems.
Diffstat (limited to 'source/files.c')
-rw-r--r-- | source/files.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/source/files.c b/source/files.c index 046cae7..4d51721 100644 --- a/source/files.c +++ b/source/files.c @@ -2466,7 +2466,7 @@ qboolean FS_SafeToRestart( void ) { fsFile_t *file; int i; - /* make sure no files are opened for reading */ + // make sure no files are opened for reading for( i = 0, file = fs_files; i < MAX_FILE_HANDLES; i++, file++ ) { if( file->type == FS_FREE ) { continue; @@ -2531,6 +2531,22 @@ void FS_Restart( void ) { } /* +============ +FS_Restart_f + +Console command to re-start the file system. +============ +*/ +static void FS_Restart_f( void ) { + if( !FS_SafeToRestart() ) { + Com_Printf( "Can't \"%s\", there are some open file handles.\n", Cmd_Argv( 0 ) ); + return; + } + + CL_RestartFilesystem(); +} + +/* ================ FS_FillAPI ================ @@ -2559,6 +2575,7 @@ static const cmdreg_t c_fs[] = { { "whereis", FS_WhereIs_f }, { "link", FS_Link_f, FS_Link_g }, { "unlink", FS_UnLink_f, FS_Link_g }, + { "fs_restart", FS_Restart_f }, { NULL } }; |