From 015227d831b60b140510e48f443cfa13edbebd25 Mon Sep 17 00:00:00 2001 From: "Tony J. White" Date: Tue, 12 Dec 2006 18:22:44 +0000 Subject: * (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 --- src/game/g_admin.c | 3 ++- src/game/g_cmds.c | 12 +++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'src') 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 { -- cgit