Change more operator commands to require sv_running to be usable. Patch by Ensiform.

This commit is contained in:
Zack Middleton 2012-11-01 06:03:15 +00:00
parent 262e8e96b6
commit 8234225459

View file

@ -639,6 +639,11 @@ static void SV_RehashBans_f(void)
char *textbuf, *curpos, *maskpos, *newlinepos, *endpos; char *textbuf, *curpos, *maskpos, *newlinepos, *endpos;
char filepath[MAX_QPATH]; char filepath[MAX_QPATH];
// make sure server is running
if ( !com_sv_running->integer ) {
return;
}
serverBansCount = 0; serverBansCount = 0;
if(!sv_banFile->string || !*sv_banFile->string) if(!sv_banFile->string || !*sv_banFile->string)
@ -709,7 +714,7 @@ static void SV_RehashBans_f(void)
/* /*
================== ==================
SV_WriteBans_f SV_WriteBans
Save bans to file. Save bans to file.
================== ==================
@ -827,6 +832,12 @@ static void SV_AddBanToList(qboolean isexception)
int index, argc, mask; int index, argc, mask;
serverBan_t *curban; serverBan_t *curban;
// make sure server is running
if ( !com_sv_running->integer ) {
Com_Printf( "Server is not running.\n" );
return;
}
argc = Cmd_Argc(); argc = Cmd_Argc();
if(argc < 2 || argc > 3) if(argc < 2 || argc > 3)
@ -858,11 +869,6 @@ static void SV_AddBanToList(qboolean isexception)
client_t *cl; client_t *cl;
// client num. // client num.
if(!com_sv_running->integer)
{
Com_Printf("Server is not running.\n");
return;
}
cl = SV_GetPlayerByNum(); cl = SV_GetPlayerByNum();
@ -968,6 +974,12 @@ static void SV_DelBanFromList(qboolean isexception)
netadr_t ip; netadr_t ip;
char *banstring; char *banstring;
// make sure server is running
if ( !com_sv_running->integer ) {
Com_Printf( "Server is not running.\n" );
return;
}
if(Cmd_Argc() != 2) if(Cmd_Argc() != 2)
{ {
Com_Printf ("Usage: %s (ip[/subnet] | num)\n", Cmd_Argv(0)); Com_Printf ("Usage: %s (ip[/subnet] | num)\n", Cmd_Argv(0));
@ -1053,6 +1065,12 @@ static void SV_ListBans_f(void)
int index, count; int index, count;
serverBan_t *ban; serverBan_t *ban;
// make sure server is running
if ( !com_sv_running->integer ) {
Com_Printf( "Server is not running.\n" );
return;
}
// List all bans // List all bans
for(index = count = 0; index < serverBansCount; index++) for(index = count = 0; index < serverBansCount; index++)
{ {
@ -1089,6 +1107,12 @@ Delete all bans and exceptions.
static void SV_FlushBans_f(void) static void SV_FlushBans_f(void)
{ {
// make sure server is running
if ( !com_sv_running->integer ) {
Com_Printf( "Server is not running.\n" );
return;
}
serverBansCount = 0; serverBansCount = 0;
// empty the ban file. // empty the ban file.
@ -1285,6 +1309,12 @@ Examine the serverinfo string
=========== ===========
*/ */
static void SV_Serverinfo_f( void ) { static void SV_Serverinfo_f( void ) {
// make sure server is running
if ( !com_sv_running->integer ) {
Com_Printf( "Server is not running.\n" );
return;
}
Com_Printf ("Server info settings:\n"); Com_Printf ("Server info settings:\n");
Info_Print ( Cvar_InfoString( CVAR_SERVERINFO ) ); Info_Print ( Cvar_InfoString( CVAR_SERVERINFO ) );
} }
@ -1294,10 +1324,16 @@ static void SV_Serverinfo_f( void ) {
=========== ===========
SV_Systeminfo_f SV_Systeminfo_f
Examine or change the serverinfo string Examine the systeminfo string
=========== ===========
*/ */
static void SV_Systeminfo_f( void ) { static void SV_Systeminfo_f( void ) {
// make sure server is running
if ( !com_sv_running->integer ) {
Com_Printf( "Server is not running.\n" );
return;
}
Com_Printf ("System info settings:\n"); Com_Printf ("System info settings:\n");
Info_Print ( Cvar_InfoString_Big( CVAR_SYSTEMINFO ) ); Info_Print ( Cvar_InfoString_Big( CVAR_SYSTEMINFO ) );
} }