From 523411fb188b851ed46e72acfd9bd981abf432fc Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Sat, 22 Apr 2006 23:01:43 +0000 Subject: * Fixed retarded exploitable "kick" command * Removed ability to change the timelimit by vote * Added sprint ability to human tutorial text --- src/server/sv_ccmds.c | 63 ++++++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 31 deletions(-) (limited to 'src/server/sv_ccmds.c') 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 { @@ -305,6 +305,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 @@ -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 \nkick all = kick everyone\nkick allbots = kick all bots\n"); + Com_Printf ("Usage: kick \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); -- cgit