I needed a way to kill all running scripts in one shot to save time while developing stuff so ive added KILL_ALL_SCRIPTS command to rConsoleCout.cpp
Its basically a clone of LIST_SCRIPTS but instead of displaying the script names it kills them
I know is a messy way to do it but I just wanted something quick that would work, Im sure someone could do better
heres the code if anyone needs it, just paste it in. i put it after the other script functions just before the #endif /* KRAWALL_SERVER */
Code: Select all
// ********************************
// *** Galaxip KILL_ALL_SCRIPTS ***
// ********************************
void sr_killAllScriptsCommand( std::istream & s )
{
int numberScripts = 0;
for( int i = sr_inputStreams.Len()-1; i >= 0; --i )
{
rScriptStream * script = dynamic_cast< rScriptStream * >( (rStream*)sr_inputStreams[i] );
if( script )
{
sr_KillScript( script->GetName() );
numberScripts++;
}
}
if (!numberScripts)
con << "No scripts are currently running.\n";
}
static tConfItemFunc sr_killAllScriptsFunc( "KILL_ALL_SCRIPTS", sr_killAllScriptsCommand );
static tAccessLevelSetter sr_killAllScriptsALS( sr_killAllScriptsFunc, tAccessLevel_Owner );