summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2006-04-22 23:01:43 +0000
committerTim Angus <tim@ngus.net>2006-04-22 23:01:43 +0000
commit523411fb188b851ed46e72acfd9bd981abf432fc (patch)
tree3e957db85cb70f6e3cd4fd692847a7a561ecb6cc /src
parentf559c2d486ce3bab66a4f1c0601e934ee841a317 (diff)
* Fixed retarded exploitable "kick" command
* Removed ability to change the timelimit by vote * Added sprint ability to human tutorial text
Diffstat (limited to 'src')
-rw-r--r--src/cgame/cg_tutorial.c4
-rw-r--r--src/game/g_cmds.c10
-rw-r--r--src/qcommon/qcommon.h2
-rw-r--r--src/server/sv_ccmds.c63
4 files changed, 41 insertions, 38 deletions
diff --git a/src/cgame/cg_tutorial.c b/src/cgame/cg_tutorial.c
index 035d8304..91df7864 100644
--- a/src/cgame/cg_tutorial.c
+++ b/src/cgame/cg_tutorial.c
@@ -487,6 +487,10 @@ static void CG_HumanText( char *text, playerState_t *ps )
Q_strcat( text, MAX_TUTORIAL_TEXT,
va( "Press %s to use a structure\n",
CG_KeyNameForCommand( "+button7" ) ) );
+
+ Q_strcat( text, MAX_TUTORIAL_TEXT,
+ va( "Press %s to sprint\n",
+ CG_KeyNameForCommand( "boost" ) ) );
}
/*
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index 274f4a4a..875a922a 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -755,13 +755,11 @@ void Cmd_CallVote_f( gentity_t *ent )
else if( !Q_stricmp( arg1, "map" ) ) { }
else if( !Q_stricmp( arg1, "kick" ) ) { }
else if( !Q_stricmp( arg1, "clientkick" ) ) { }
- else if( !Q_stricmp( arg1, "timelimit" ) ) { }
else
{
trap_SendServerCommand( ent-g_entities, "print \"Invalid vote string\n\"" );
trap_SendServerCommand( ent-g_entities, "print \"Vote commands are: map_restart, nextmap, map <mapname>, "
- "kick <player>, clientkick <clientnum>, "
- "timelimit <time>\n\"" );
+ "kick <player>, clientkick <clientnum>\n\"" );
return;
}
@@ -808,7 +806,8 @@ void Cmd_CallVote_f( gentity_t *ent )
Com_sprintf( level.voteDisplayString, sizeof( level.voteDisplayString ), "%s", level.voteString );
}
- trap_SendServerCommand( -1, va( "print \"%s called a vote\n\"", ent->client->pers.netname ) );
+ trap_SendServerCommand( -1, va( "print \"%s" S_COLOR_WHITE
+ " called a vote\n\"", ent->client->pers.netname ) );
// start the voting, the caller autoamtically votes yes
level.voteTime = level.time;
@@ -952,7 +951,8 @@ void Cmd_CallTeamVote_f( gentity_t *ent )
if( i >= level.maxclients )
{
- trap_SendServerCommand( ent-g_entities, va( "print \"%s is not a valid player on your team\n\"", arg2 ) );
+ trap_SendServerCommand( ent-g_entities, va( "print \"%s "
+ S_COLOR_WHITE "is not a valid player on your team\n\"", arg2 ) );
return;
}
}
diff --git a/src/qcommon/qcommon.h b/src/qcommon/qcommon.h
index 96d6e517..eb89de47 100644
--- a/src/qcommon/qcommon.h
+++ b/src/qcommon/qcommon.h
@@ -33,8 +33,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#endif
#endif
-//#define PRE_RELEASE_DEMO
-
//============================================================================
//
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);