[quake3-commits] r2349 - trunk/code/server
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Thu Nov 1 02:03:15 EDT 2012
Author: ztm
Date: 2012-11-01 02:03:15 -0400 (Thu, 01 Nov 2012)
New Revision: 2349
Modified:
trunk/code/server/sv_ccmds.c
Log:
Change more operator commands to require sv_running to be usable. Patch by Ensiform.
Modified: trunk/code/server/sv_ccmds.c
===================================================================
--- trunk/code/server/sv_ccmds.c 2012-10-30 22:05:07 UTC (rev 2348)
+++ trunk/code/server/sv_ccmds.c 2012-11-01 06:03:15 UTC (rev 2349)
@@ -639,6 +639,11 @@
char *textbuf, *curpos, *maskpos, *newlinepos, *endpos;
char filepath[MAX_QPATH];
+ // make sure server is running
+ if ( !com_sv_running->integer ) {
+ return;
+ }
+
serverBansCount = 0;
if(!sv_banFile->string || !*sv_banFile->string)
@@ -709,7 +714,7 @@
/*
==================
-SV_WriteBans_f
+SV_WriteBans
Save bans to file.
==================
@@ -826,7 +831,13 @@
netadr_t ip;
int index, argc, mask;
serverBan_t *curban;
-
+
+ // make sure server is running
+ if ( !com_sv_running->integer ) {
+ Com_Printf( "Server is not running.\n" );
+ return;
+ }
+
argc = Cmd_Argc();
if(argc < 2 || argc > 3)
@@ -858,11 +869,6 @@
client_t *cl;
// client num.
- if(!com_sv_running->integer)
- {
- Com_Printf("Server is not running.\n");
- return;
- }
cl = SV_GetPlayerByNum();
@@ -968,6 +974,12 @@
netadr_t ip;
char *banstring;
+ // make sure server is running
+ if ( !com_sv_running->integer ) {
+ Com_Printf( "Server is not running.\n" );
+ return;
+ }
+
if(Cmd_Argc() != 2)
{
Com_Printf ("Usage: %s (ip[/subnet] | num)\n", Cmd_Argv(0));
@@ -1052,6 +1064,12 @@
{
int index, count;
serverBan_t *ban;
+
+ // make sure server is running
+ if ( !com_sv_running->integer ) {
+ Com_Printf( "Server is not running.\n" );
+ return;
+ }
// List all bans
for(index = count = 0; index < serverBansCount; index++)
@@ -1089,6 +1107,12 @@
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;
// empty the ban file.
@@ -1285,6 +1309,12 @@
===========
*/
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");
Info_Print ( Cvar_InfoString( CVAR_SERVERINFO ) );
}
@@ -1294,10 +1324,16 @@
===========
SV_Systeminfo_f
-Examine or change the serverinfo string
+Examine the systeminfo string
===========
*/
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");
Info_Print ( Cvar_InfoString_Big( CVAR_SYSTEMINFO ) );
}
More information about the quake3-commits
mailing list