Use country number as journal thread ID when possible

Before, we used the value of empth_thread().  That can be mapped to
countries by tracking login and logout.  Easy for machines (except
when the journal is rotated while players are logged in), but tedious
for humans.

Quick version for Hvy Metal II.  Needs further work for the stock
code.
This commit is contained in:
Markus Armbruster 2008-07-29 07:32:36 -04:00
parent 3afc1b1989
commit a87f73a3b5

View file

@ -80,8 +80,12 @@ journal_entry(char *fmt, ...)
if (journal) {
time(&now);
fprintf(journal, "%.24s %p ", ctime(&now), empth_self());
fprintf(journal, "%.24s ", ctime(&now));
if (player && player->state == PS_PLAYING)
fprintf(journal, "%d ", player->cnum);
else
fprintf(journal, "%p ", empth_self());
va_start(ap, fmt);
vsnprintf(buf, sizeof(buf) - 1, fmt, ap);
va_end(ap);