summaryrefslogtreecommitdiff
path: root/src/game/g_cmds.c
diff options
context:
space:
mode:
authorTony J. White <tjw@tjw.org>2006-12-31 23:26:40 +0000
committerTony J. White <tjw@tjw.org>2006-12-31 23:26:40 +0000
commitba321f960adefb7e1694e2d6ae7e113a36910043 (patch)
treefa3049a23d1b0d64d75739a5588321120c816e90 /src/game/g_cmds.c
parent2556ac4c9b09454585992601d797e5765d055aa0 (diff)
* (bug 2954) g_admin commands can not be used from the server console even
if g_admin is not set to a file. This allows the !kick and !ban commands to work for the current game even if there is no g_admin data file. Updated vote cmds to always use !ban instead of clientkick.
Diffstat (limited to 'src/game/g_cmds.c')
-rw-r--r--src/game/g_cmds.c39
1 files changed, 11 insertions, 28 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index fc5fff19..f17236d5 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -886,7 +886,7 @@ void G_Say( gentity_t *ent, gentity_t *target, int mode, const char *chatText )
G_SayTo( ent, other, mode, color, name, text );
}
- if( g_adminParseSay.integer )
+ if( g_admin.string[ 0 ] && g_adminParseSay.integer )
{
G_admin_cmd_check ( ent, qtrue );
}
@@ -1091,18 +1091,10 @@ void Cmd_CallVote_f( gentity_t *ent )
Q_strncpyz( kickee, level.clients[ clientNum ].pers.netname,
sizeof( kickee ) );
Q_CleanStr( kickee );
- if( g_admin.string[ 0 ] )
- {
- // use ip in case this player disconnects before the vote ends
- Com_sprintf( level.voteString, sizeof( level.voteString ),
- "!ban %s %d vote kick", level.clients[ clientNum ].pers.ip,
- g_adminTempBan.integer + 1 );
- }
- else
- {
- Com_sprintf( level.voteString, sizeof( level.voteString ),
- "clientkick %d", clientNum );
- }
+ // use ip in case this player disconnects before the vote ends
+ Com_sprintf( level.voteString, sizeof( level.voteString ),
+ "!ban %s %d vote kick", level.clients[ clientNum ].pers.ip,
+ g_adminTempBan.integer + 1 );
Com_sprintf( level.voteDisplayString, sizeof( level.voteDisplayString ),
"Kick player \'%s\'", kickee );
}
@@ -1340,20 +1332,11 @@ void Cmd_CallTeamVote_f( gentity_t *ent )
sizeof( kickee ) );
Q_CleanStr( kickee );
- if( g_admin.string[ 0 ] )
- {
- // use ip in case this player disconnects before the vote ends
- Com_sprintf( level.teamVoteString[ cs_offset ],
- sizeof( level.teamVoteString[ cs_offset ] ),
- "!ban %s %d team vote kick", level.clients[ clientNum ].pers.ip,
- g_adminTempBan.integer + 1 );
- }
- else
- {
- Com_sprintf( level.teamVoteString[ cs_offset ],
- sizeof( level.teamVoteString[ cs_offset ] ),
- "clientkick %d", clientNum );
- }
+ // use ip in case this player disconnects before the vote ends
+ Com_sprintf( level.teamVoteString[ cs_offset ],
+ sizeof( level.teamVoteString[ cs_offset ] ),
+ "!ban %s %d team vote kick", level.clients[ clientNum ].pers.ip,
+ g_adminTempBan.integer + 1 );
Com_sprintf( level.teamVoteDisplayString[ cs_offset ],
sizeof( level.teamVoteDisplayString[ cs_offset ] ),
"Kick player \'%s\'", kickee );
@@ -2729,7 +2712,7 @@ void ClientCommand( int clientNum )
return;
}
- if( G_admin_cmd_check( ent, qfalse ) )
+ if( g_admin.string[ 0 ] && G_admin_cmd_check( ent, qfalse ) )
return;
// ignore all other commands when at intermission