diff options
author | Christopher Schwarz <lakitu7@gmail.com> | 2009-10-14 19:22:04 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-03 00:16:50 +0000 |
commit | 98abaa24e6ba46aaa44a0d458a0f4f2208ace21d (patch) | |
tree | 08abc66855538bf031036a91fdd28377886a5a4b /src/game/g_main.c | |
parent | 7615d380395b6bfc33a8819810433ebf94990a09 (diff) |
* (bug 4306) Fix display formatting between different types of chat text
* Support parsing /say_area out of /say
* General cleanups/refactors to messaging code
Diffstat (limited to 'src/game/g_main.c')
-rw-r--r-- | src/game/g_main.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/game/g_main.c b/src/game/g_main.c index 7f104a15..f8740dcb 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -1628,25 +1628,17 @@ void ExitLevel( void ) G_AdminMessage Print to all active server admins, and to the logfile, and to the server console -Prepend *prefix, or '[SERVER]' if no *prefix is given ================= */ -void QDECL G_AdminMessage( gentity_t *ent, const char *fmt, ... ) +void G_AdminMessage( gentity_t *ent, const char *msg ) { - va_list argptr; char string[ 1024 ]; - char outstring[ 1024 ] = S_COLOR_MAGENTA; int i; - // Format the text - va_start( argptr, fmt ); - Q_vsnprintf( string, sizeof( string ), fmt, argptr ); - va_end( argptr ); - - // Create the final string - Q_strcat( outstring, sizeof( outstring ), string ); - Com_sprintf( string, sizeof( string ), "chat %d \"%s\"", - ent ? ent - g_entities : -1, outstring ); + Com_sprintf( string, sizeof( string ), "chat %d %d \"" S_COLOR_MAGENTA "%s\"", + ent ? ent - g_entities : -1, + G_admin_permission( ent, ADMF_ADMINCHAT ) ? SAY_ADMINS : SAY_ADMINS_PUBLIC, + msg ); // Send to all appropriate clients for( i = 0; i < level.maxclients; i++ ) @@ -1654,9 +1646,10 @@ void QDECL G_AdminMessage( gentity_t *ent, const char *fmt, ... ) trap_SendServerCommand( i, string ); // Send to the logfile and server console - G_LogPrintf( "AdminMsg: %d \"%s" S_COLOR_WHITE "\": %s\n", + G_LogPrintf( "%s: %d \"%s" S_COLOR_WHITE "\": " S_COLOR_MAGENTA "%s\n", + G_admin_permission( ent, ADMF_ADMINCHAT ) ? "AdminMsg" : "AdminMsgPublic", ent ? ent - g_entities : -1, ent ? ent->client->pers.netname : "console", - outstring ); + msg ); } |