diff options
author | /dev/humancontroller <devhc@example.com> | 2017-04-13 11:30:00 +0000 |
---|---|---|
committer | /dev/humancontroller <devhc@example.com> | 2017-04-15 17:24:21 +0200 |
commit | ef3cc5396fbcf193ddd1e3b6b5978bdda4bdbe55 (patch) | |
tree | 38b215c1adbe61503456a25b63f8fab10ab703e1 /src/game/g_cmds.c | |
parent | 90094e0e71e05b155a6a1edb1835607e1202a8bc (diff) |
implement logging control for PMs
configurable via the new g_logPrivateMessages cvar:
0: do not log anything
1: log that a PM was sent, and to what name-pattern
2: log the contents of the PMs too
a PM to the console is not considered a real PM.
(logging is parallel with printing to the console.)
Diffstat (limited to 'src/game/g_cmds.c')
-rw-r--r-- | src/game/g_cmds.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index f93b2f8..dad9cfe 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -5799,10 +5799,14 @@ void G_PrivateMessage( gentity_t *ent ) ADMP( va( "%s\n", str ) ); - G_LogPrintf( "%s: %s^7: %s^7: %s\n", - ( teamonly ) ? "tprivmsg" : "privmsg", - ( ent ) ? ent->client->pers.netname : "console", - name, msg ); + if( g_logPrivateMessages.integer >= 1 ) + { + G_LogPrintf( "%s: %s^7: %s^7%s%s\n", + ( teamonly ) ? "tprivmsg" : "privmsg", + ( ent ) ? ent->client->pers.netname : "console", + name, g_logPrivateMessages.integer >= 2 ? ": " : "", + g_logPrivateMessages.integer >= 2 ? msg : "" ); + } } if( ignored ) |