added the fs_restart command

This commit is contained in:
myT 2018-01-25 05:29:53 +01:00
parent 5ea79f073c
commit 4b99ff0cc5
4 changed files with 28 additions and 12 deletions

View file

@ -1,6 +1,8 @@
DD Mmm 18 - 1.50 DD Mmm 18 - 1.50
add: the fs_restart command to manually restart the file system
chg: during id downloads (cl_allowDownload -1), the time-out is 5 seconds instead of cl_timeout chg: during id downloads (cl_allowDownload -1), the time-out is 5 seconds instead of cl_timeout
chg: the "nextdemo" cvar is now also used when playback stops before reaching the demo's end chg: the "nextdemo" cvar is now also used when playback stops before reaching the demo's end

View file

@ -773,6 +773,14 @@ void Cmd_RegisterTable( const cmdTableItem_t* cmds, int count, module_t module )
} }
void Cmd_UnregisterTable( const cmdTableItem_t* cmds, int count )
{
for ( int i = 0; i < count; ++i ) {
Cmd_RemoveCommand( cmds[i].name );
}
}
void Cmd_SetModule( const char* cmd_name, module_t module ) void Cmd_SetModule( const char* cmd_name, module_t module )
{ {
cmd_function_t* cmd; cmd_function_t* cmd;

View file

@ -2478,6 +2478,21 @@ qbool FS_PakExists( unsigned int checksum )
} }
static void FS_Restart_f()
{
FS_Restart(fs_checksumFeed);
}
static const cmdTableItem_t fs_cmds[] =
{
{ "path", FS_Path_f, NULL, "prints info about the current search path" },
{ "dir", FS_Dir_f, NULL, "prints an extension-filtered file list" },
{ "fdir", FS_NewDir_f, NULL, "prints a pattern-filtered file list" },
{ "fs_restart", FS_Restart_f, NULL, "restarts the file system" }
};
/* /*
================ ================
FS_Shutdown FS_Shutdown
@ -2513,9 +2528,7 @@ void FS_Shutdown( qbool closemfp ) {
// any FS_ calls will now be an error until reinitialized // any FS_ calls will now be an error until reinitialized
fs_searchpaths = NULL; fs_searchpaths = NULL;
Cmd_RemoveCommand( "path" ); Cmd_UnregisterArray( fs_cmds );
Cmd_RemoveCommand( "dir" );
Cmd_RemoveCommand( "fdir" );
#ifdef FS_MISSING #ifdef FS_MISSING
if (closemfp) { if (closemfp) {
@ -2565,14 +2578,6 @@ static void FS_ReorderPurePaks()
} }
static const cmdTableItem_t fs_cmds[] =
{
{ "path", FS_Path_f, NULL, "prints info about the current search path" },
{ "dir", FS_Dir_f, NULL, "prints an extension-filtered file list" },
{ "fdir", FS_NewDir_f, NULL, "prints a pattern-filtered file list" }
};
static void FS_Startup( const char *gameName ) static void FS_Startup( const char *gameName )
{ {
QSUBSYSTEM_INIT_START( "FileSystem" ); QSUBSYSTEM_INIT_START( "FileSystem" );

View file

@ -390,7 +390,8 @@ qbool Cmd_GetHelp( const char** desc, const char** help, const char* cmd_name );
void Cmd_RegisterTable( const cmdTableItem_t* cmds, int count, module_t module ); void Cmd_RegisterTable( const cmdTableItem_t* cmds, int count, module_t module );
void Cmd_UnregisterTable( const cmdTableItem_t* cmds, int count ); void Cmd_UnregisterTable( const cmdTableItem_t* cmds, int count );
#define Cmd_RegisterArray(a, m) Cmd_RegisterTable( a, ARRAY_LEN(a), m ) #define Cmd_RegisterArray( a, m ) Cmd_RegisterTable( a, ARRAY_LEN(a), m )
#define Cmd_UnregisterArray( a ) Cmd_UnregisterTable( a, ARRAY_LEN(a) )
void Cmd_SetModule( const char* cmd_name, module_t module ); void Cmd_SetModule( const char* cmd_name, module_t module );