diff options
author | M. Kristall <mkpdev@gmail.com> | 2007-09-25 06:44:19 +0000 |
---|---|---|
committer | M. Kristall <mkpdev@gmail.com> | 2007-09-25 06:44:19 +0000 |
commit | ed1a89fccdb41810c4d634005a1b1b1ac8f40c8f (patch) | |
tree | 0f1886244fd7d39b79245e9fe44521044864c387 /src/game/g_main.c | |
parent | 8534520221091bc0e6a5127b674de8c6a55d07a8 (diff) |
* (bug 3307) use boundary checking to prevent potential buffer overflow
* (bug 2969) limit number of players to g_maxGameClients
* use G_TeamCommand() for team vote messages
Diffstat (limited to 'src/game/g_main.c')
-rw-r--r-- | src/game/g_main.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/game/g_main.c b/src/game/g_main.c index 14986dbb..84209315 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -148,9 +148,10 @@ static cvarTable_t gameCvarTable[ ] = // latched vars { &g_maxclients, "sv_maxclients", "8", CVAR_SERVERINFO | CVAR_LATCH | CVAR_ARCHIVE, 0, qfalse }, - { &g_maxGameClients, "g_maxGameClients", "0", CVAR_SERVERINFO | CVAR_LATCH | CVAR_ARCHIVE, 0, qfalse }, // change anytime vars + { &g_maxGameClients, "g_maxGameClients", "0", CVAR_SERVERINFO | CVAR_ARCHIVE, 0, qfalse }, + { &g_timelimit, "timelimit", "0", CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_NORESTART, 0, qtrue }, { &g_suddenDeathTime, "g_suddenDeathTime", "0", CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_NORESTART, 0, qtrue }, @@ -2106,21 +2107,20 @@ void CheckTeamVote( int team ) if( level.time - level.teamVoteTime[ cs_offset ] >= VOTE_TIME ) { - trap_SendServerCommand( -1, "print \"Team vote failed\n\"" ); + G_TeamCommand( team, "print \"Team vote failed\n\"" ); } else { if( level.teamVoteYes[ cs_offset ] > level.numteamVotingClients[ cs_offset ] / 2 ) { // execute the command, then remove the vote - trap_SendServerCommand( -1, "print \"Team vote passed\n\"" ); - // + G_TeamCommand( team, "print \"Team vote passed\n\"" ); trap_SendConsoleCommand( EXEC_APPEND, va( "%s\n", level.teamVoteString[ cs_offset ] ) ); } else if( level.teamVoteNo[ cs_offset ] >= level.numteamVotingClients[ cs_offset ] / 2 ) { // same behavior as a timeout - trap_SendServerCommand( -1, "print \"Team vote failed\n\"" ); + G_TeamCommand( team, "print \"Team vote failed\n\"" ); } else { |