Chronicle of major events, and livelog

Log game events, such as entering a new dungeon level, breaking
a conduct, or killing a unique monster, in a new "Major events"
chronicle. The entries record the turn when the event happened.
The log can be viewed with #chronicle -command, and the entries
also show up in the end-of-game dump, if that is available.

This feature is on by default, but can be disabled by
defining NO_CHRONICLE compile-time option.

This also contains "live logging", writing the events as they
happen into a single livelog-file. This is mostly useful for
public servers. The livelog is off by default, and must be
compiled in with LIVELOG, and then turned on in sysconf.

Mostly this a version of livelogging from the Hardfought server,
with some changes.
This commit is contained in:
Pasi Kallinen
2022-02-09 22:49:25 +02:00
parent cfcfc3429f
commit 1e90f89203
43 changed files with 624 additions and 53 deletions
+18 -3
View File
@@ -173,9 +173,9 @@
/*
* Section 2: Some global parameters and filenames.
*
* LOGFILE, XLOGFILE, NEWS and PANICLOG refer to files in
* the playground directory. Commenting out LOGFILE, XLOGFILE,
* NEWS or PANICLOG removes that feature from the game.
* LOGFILE, XLOGFILE, LIVELOGFILE, NEWS and PANICLOG refer to
* files in the playground directory. Commenting out LOGFILE,
* XLOGFILE, NEWS or PANICLOG removes that feature from the game.
*
* Building with debugging features enabled is now unconditional;
* the old WIZARD setting for that has been eliminated.
@@ -598,6 +598,21 @@ typedef unsigned char uchar;
whole thing, then type a new end for the text. */
/* #define EDIT_GETLIN */
#ifndef NO_CHRONICLE
/* CHRONICLE - enable #chronicle command, a log of major game events.
The logged messages will also appear in DUMPLOG. */
#define CHRONICLE
#ifdef CHRONICLE
/* LIVELOG - log CHRONICLE events into LIVELOGFILE as they happen. */
/* #define LIVELOG */
#ifdef LIVELOG
#define LIVELOGFILE "livelog" /* in-game events recorded, live */
#endif /* LIVELOG */
#endif /* CHRONICLE */
#else
#undef LIVELOG
#endif /* NO_CHRONICLE */
/* #define DUMPLOG */ /* End-of-game dump logs */
#ifdef DUMPLOG