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:
parent
3afc1b1989
commit
a87f73a3b5
1 changed files with 6 additions and 2 deletions
|
@ -80,7 +80,11 @@ 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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue