summaryrefslogtreecommitdiff
path: root/src/server/sv_ccmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/sv_ccmds.c')
-rw-r--r--src/server/sv_ccmds.c63
1 files changed, 32 insertions, 31 deletions
diff --git a/src/server/sv_ccmds.c b/src/server/sv_ccmds.c
index fde921d1..55ee62fd 100644
--- a/src/server/sv_ccmds.c
+++ b/src/server/sv_ccmds.c
@@ -155,7 +155,7 @@ static void SV_Map_f( void ) {
}
cmd = Cmd_Argv(0);
- if ( !Q_stricmp( cmd, "devmap" ) || !Q_stricmp( cmd, "spdevmap" ) ) {
+ if ( !Q_stricmp( cmd, "devmap" ) ) {
cheat = qtrue;
killBots = qtrue;
} else {
@@ -307,6 +307,35 @@ static void SV_MapRestart_f( void ) {
/*
==================
+SV_KickAll_f
+
+Kick all users off of the server FIXME: move to game
+==================
+*/
+static void SV_KickAll_f( void ) {
+ client_t *cl;
+ int i;
+
+ // make sure server is running
+ if ( !com_sv_running->integer ) {
+ Com_Printf( "Server is not running.\n" );
+ return;
+ }
+
+ for ( i=0, cl=svs.clients ; i < sv_maxclients->integer ; i++,cl++ ) {
+ if ( !cl->state ) {
+ continue;
+ }
+ if( cl->netchan.remoteAddress.type == NA_LOOPBACK ) {
+ continue;
+ }
+ SV_DropClient( cl, "was kicked" );
+ cl->lastPacketTime = svs.time; // in case there is a funny zombie
+ }
+}
+
+/*
+==================
SV_Kick_f
Kick a user off of the server FIXME: move to game
@@ -314,7 +343,6 @@ Kick a user off of the server FIXME: move to game
*/
static void SV_Kick_f( void ) {
client_t *cl;
- int i;
// make sure server is running
if ( !com_sv_running->integer ) {
@@ -323,36 +351,12 @@ static void SV_Kick_f( void ) {
}
if ( Cmd_Argc() != 2 ) {
- Com_Printf ("Usage: kick <player name>\nkick all = kick everyone\nkick allbots = kick all bots\n");
+ Com_Printf ("Usage: kick <player name>\n");
return;
}
cl = SV_GetPlayerByName();
if ( !cl ) {
- if ( !Q_stricmp(Cmd_Argv(1), "all") ) {
- for ( i=0, cl=svs.clients ; i < sv_maxclients->integer ; i++,cl++ ) {
- if ( !cl->state ) {
- continue;
- }
- if( cl->netchan.remoteAddress.type == NA_LOOPBACK ) {
- continue;
- }
- SV_DropClient( cl, "was kicked" );
- cl->lastPacketTime = svs.time; // in case there is a funny zombie
- }
- }
- else if ( !Q_stricmp(Cmd_Argv(1), "allbots") ) {
- for ( i=0, cl=svs.clients ; i < sv_maxclients->integer ; i++,cl++ ) {
- if ( !cl->state ) {
- continue;
- }
- if( cl->netchan.remoteAddress.type != NA_BOT ) {
- continue;
- }
- SV_DropClient( cl, "was kicked" );
- cl->lastPacketTime = svs.time; // in case there is a funny zombie
- }
- }
return;
}
if( cl->netchan.remoteAddress.type == NA_LOOPBACK ) {
@@ -708,6 +712,7 @@ void SV_AddOperatorCommands( void ) {
Cmd_AddCommand ("heartbeat", SV_Heartbeat_f);
Cmd_AddCommand ("kick", SV_Kick_f);
+ Cmd_AddCommand ("kickAll", SV_KickAll_f);
Cmd_AddCommand ("banUser", SV_Ban_f);
Cmd_AddCommand ("banClient", SV_BanNum_f);
Cmd_AddCommand ("clientkick", SV_KickNum_f);
@@ -718,11 +723,7 @@ void SV_AddOperatorCommands( void ) {
Cmd_AddCommand ("map_restart", SV_MapRestart_f);
Cmd_AddCommand ("sectorlist", SV_SectorList_f);
Cmd_AddCommand ("map", SV_Map_f);
-#ifndef PRE_RELEASE_DEMO
Cmd_AddCommand ("devmap", SV_Map_f);
- Cmd_AddCommand ("spmap", SV_Map_f);
- Cmd_AddCommand ("spdevmap", SV_Map_f);
-#endif
Cmd_AddCommand ("killserver", SV_KillServer_f);
if( com_dedicated->integer ) {
Cmd_AddCommand ("say", SV_ConSay_f);