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.
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);