summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTony J. White <tjw@tjw.org>2006-12-12 18:22:44 +0000
committerTony J. White <tjw@tjw.org>2006-12-12 18:22:44 +0000
commit015227d831b60b140510e48f443cfa13edbebd25 (patch)
tree084c4423b6a80a2ce0dcf3aab79e7a52ec9d215f /src
parent12b4739e3cc6005e882f2daf3b0489e3b4aff04b (diff)
* (bug 2954) when g_admin is enabled use !ban [ip] instead of !kick [slot]
on vote kicks. this is to deal with people disconnecting before the vote ends to avoid the temp ban and prevents an innocent from grabbing the slot only to be kicked when the vote ends. * fix duration parsing for the g_admin !ban command when time is in seconds
Diffstat (limited to 'src')
-rw-r--r--src/game/g_admin.c3
-rw-r--r--src/game/g_cmds.c12
2 files changed, 9 insertions, 6 deletions
diff --git a/src/game/g_admin.c b/src/game/g_admin.c
index 0be535f6..3767c52a 100644
--- a/src/game/g_admin.c
+++ b/src/game/g_admin.c
@@ -1659,7 +1659,8 @@ qboolean G_admin_ban( gentity_t *ent, int skiparg )
modifier = 60 * 60;
else if( secs[ lastchar ] == 'm' )
modifier = 60;
- secs[ lastchar ] = '\0';
+ else if( secs[ lastchar ] < '0' || secs[ lastchar ] > '9' )
+ secs[ lastchar ] = '\0';
}
seconds = atoi( secs );
if( seconds > 0 )
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index 5a6a251d..3471955a 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -1093,9 +1093,10 @@ void Cmd_CallVote_f( gentity_t *ent )
Q_CleanStr( kickee );
if( g_admin.string[ 0 ] )
{
- // !kick will add a temp ban and a descriptive drop message
+ // use ip in case this player disconnects before the vote ends
Com_sprintf( level.voteString, sizeof( level.voteString ),
- "!kick %d vote kick", clientNum );
+ "!ban %s %d vote kick", level.clients[ clientNum ].pers.ip,
+ g_adminTempBan.integer + 1 );
}
else
{
@@ -1341,10 +1342,11 @@ void Cmd_CallTeamVote_f( gentity_t *ent )
if( g_admin.string[ 0 ] )
{
- // !kick will add a temp ban and a descriptive drop message
+ // use ip in case this player disconnects before the vote ends
Com_sprintf( level.teamVoteString[ cs_offset ],
- sizeof( level.teamVoteString[ cs_offset ] ),
- "!kick %d team vote kick", clientNum );
+ sizeof( level.teamVoteString[ cs_offset ] ),
+ "!ban %s %d team vote kick", level.clients[ clientNum ].pers.ip,
+ g_adminTempBan.integer + 1 );
}
else
{