diff options
author | M. Kristall <mkpdev@gmail.com> | 2010-02-28 19:26:18 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-03 00:17:28 +0000 |
commit | 469e96a801599283c74ac3d6091c8d4a405e5f0f (patch) | |
tree | d0807bb3e95f6cca8f74e8d0810cc88b28436c9c /src | |
parent | 3658be27d4e27b04dbef5eefa3b460f50c69b5be (diff) |
* Log what command was attempted when a user does not have permission
* (bug 4446) Fix comment
Diffstat (limited to 'src')
-rw-r--r-- | src/game/g_admin.c | 7 | ||||
-rw-r--r-- | src/game/g_admin.h | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/game/g_admin.c b/src/game/g_admin.c index 34c11f18..806d2d76 100644 --- a/src/game/g_admin.c +++ b/src/game/g_admin.c @@ -667,8 +667,11 @@ void G_admin_authlog( gentity_t *ent ) static void admin_log( gentity_t *admin, char *cmd ) { char *name; + int args = 1; name = ( admin ) ? admin->client->pers.netname : "console"; + if( !strcmp( cmd, "attempted" ) ) + args--; G_LogPrintf( "AdminCmd: %i \"%s" S_COLOR_WHITE "\" " "(\"%s" S_COLOR_WHITE "\") [%d]: %s %s\n", @@ -679,7 +682,7 @@ static void admin_log( gentity_t *admin, char *cmd ) ( admin && admin->client->pers.admin ) ? admin->client->pers.admin->level : 0, cmd, - ConcatArgs( 1 ) ); + ConcatArgs( args ) ); } static int admin_listadmins( gentity_t *ent, int start, char *search ) @@ -873,7 +876,7 @@ qboolean G_admin_cmd_check( gentity_t *ent ) } else { - admin_log( ent, S_COLOR_RED "attempted" S_COLOR_WHITE ); + admin_log( ent, "attempted" ); ADMP( va( "^3%s: ^7permission denied\n", c->command ) ); } return qtrue; diff --git a/src/game/g_admin.h b/src/game/g_admin.h index bc4158f5..126e33de 100644 --- a/src/game/g_admin.h +++ b/src/game/g_admin.h @@ -134,7 +134,7 @@ qboolean G_admin_name_check( gentity_t *ent, char *name, char *err, int len ); g_admin_admin_t *G_admin_admin( const char *guid ); void G_admin_authlog( gentity_t *ent ); -// ! command functions +// admin command functions qboolean G_admin_time( gentity_t *ent ); qboolean G_admin_setlevel( gentity_t *ent ); qboolean G_admin_kick( gentity_t *ent ); |