diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2018-03-06 22:17:49 +0100 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2018-03-06 22:38:36 +0100 |
commit | a4f55a44918811062951d1ae7ed3e706fbea34e7 (patch) | |
tree | f683df6081f0a16b627b612852e63dd36a8417f5 /src | |
parent | 432e7bec6baa7470762c19adef584bbab244aaf5 (diff) |
Log admin commands in games.log regardless of g_adminLog.
A failure to open the admin log shouldn't affect games.log or the admin chat notifications.
Diffstat (limited to 'src')
-rw-r--r-- | src/game/g_admin.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/game/g_admin.c b/src/game/g_admin.c index c46deab..61e0c1c 100644 --- a/src/game/g_admin.c +++ b/src/game/g_admin.c @@ -1380,9 +1380,21 @@ static void admin_log( gentity_t *admin, char *cmd, int skiparg ) int pids[ MAX_CLIENTS ]; char name[ MAX_NAME_LENGTH ]; - if( !g_adminLog.string[ 0 ] ) - return ; + if ( !Q_stricmp( cmd, "attempted" ) ) + { + Com_sprintf( string, sizeof( string ), + "%s^7 (%i) %s: %s", + ( admin ) ? admin->client->pers.netname : "console", + ( admin ) ? admin->s.clientNum : -1, + cmd, + G_SayConcatArgs( 1 + skiparg ) ); + G_AdminsPrintf("%s\n",string); + } + G_LogPrintf("Admin Command: %s^7 (%s): %s %s\n",( admin ) ? admin->client->pers.netname : "console", ( admin ) ? admin->client->pers.adminName : "console", cmd, G_SayConcatArgs( 1 + skiparg )); + + if( !g_adminLog.string[ 0 ] ) + return; len = trap_FS_FOpenFile( g_adminLog.string, &f, FS_APPEND ); if( len < 0 ) @@ -1475,19 +1487,6 @@ static void admin_log( gentity_t *admin, char *cmd, int skiparg ) trap_FS_Write( string, strlen( string ), f ); } trap_FS_FCloseFile( f ); - - if ( !Q_stricmp( cmd, "attempted" ) ) - { - Com_sprintf( string, sizeof( string ), - "%s^7 (%i) %s: %s", - ( admin ) ? admin->client->pers.netname : "console", - ( admin ) ? admin->s.clientNum : -1, - cmd, - G_SayConcatArgs( 1 + skiparg ) ); - G_AdminsPrintf("%s\n",string); - } - - G_LogPrintf("Admin Command: %s^7 (%s): %s %s\n",( admin ) ? admin->client->pers.netname : "console", ( admin ) ? admin->client->pers.adminName : "console", cmd, G_SayConcatArgs( 1 + skiparg )); } static int admin_listadmins( gentity_t *ent, int start, char *search, int minlevel ) |