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
+5 -4
View File
@@ -335,10 +335,11 @@ install: rootcheck $(GAME) recover $(VARDAT) spec_levs
# set up the game files
( $(MAKE) dofiles )
# set up some additional files
touch $(VARDIR)/perm $(VARDIR)/record $(VARDIR)/logfile $(VARDIR)/xlogfile
-( cd $(VARDIR) ; $(CHOWN) $(GAMEUID) perm record logfile xlogfile ; \
$(CHGRP) $(GAMEGRP) perm record logfile xlogfile ; \
chmod $(VARFILEPERM) perm record logfile xlogfile )
touch $(VARDIR)/perm $(VARDIR)/record $(VARDIR)/logfile $(VARDIR)/xlogfile \
$(VARDIR)/livelog
-( cd $(VARDIR) ; $(CHOWN) $(GAMEUID) perm record logfile xlogfile livelog ; \
$(CHGRP) $(GAMEGRP) perm record logfile xlogfile livelog ; \
chmod $(VARFILEPERM) perm record logfile xlogfile livelog )
true; $(POSTINSTALL)
# and a reminder
@echo You may also want to reinstall the man pages via the doc Makefile.
+1 -1
View File
@@ -1241,7 +1241,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "mkdir -p \"${NH_INSTALL_DIR}\"/save\ncd \"${NH_DAT_DIR}\"\ncp nhdat license symbols \"${NH_INSTALL_DIR}\"\ncp \"${NH_SRC_DIR}\"/nethack \"${NH_INSTALL_DIR}\"\ncp \"${NH_UTIL_DIR}\"/recover \"${NH_INSTALL_DIR}\"\ntouch \"${NH_INSTALL_DIR}\"/perm\ntouch \"${NH_INSTALL_DIR}\"/record\ntouch \"${NH_INSTALL_DIR}\"/logfile\ntouch \"${NH_INSTALL_DIR}\"/xlogfile\ncd \"${NH_UNIX_DIR}\"\nsh hints/macosx.sh editsysconf sysconf \"${NH_INSTALL_DIR}\"/sysconf\n";
shellScript = "mkdir -p \"${NH_INSTALL_DIR}\"/save\ncd \"${NH_DAT_DIR}\"\ncp nhdat license symbols \"${NH_INSTALL_DIR}\"\ncp \"${NH_SRC_DIR}\"/nethack \"${NH_INSTALL_DIR}\"\ncp \"${NH_UTIL_DIR}\"/recover \"${NH_INSTALL_DIR}\"\ntouch \"${NH_INSTALL_DIR}\"/perm\ntouch \"${NH_INSTALL_DIR}\"/record\ntouch \"${NH_INSTALL_DIR}\"/logfile\ntouch \"${NH_INSTALL_DIR}\"/xlogfile\ntouch \"${NH_INSTALL_DIR}\"/livelog\ncd \"${NH_UNIX_DIR}\"\nsh hints/macosx.sh editsysconf sysconf \"${NH_INSTALL_DIR}\"/sysconf\n";
};
3192867121A3A2D500325BEB /* Copy nethack */ = {
isa = PBXShellScriptBuildPhase;
+1
View File
@@ -52,6 +52,7 @@ $(WASM_DATA_DIR): $(WASM_DATA_DIR)/nhdat
touch $(WASM_DATA_DIR)/record
touch $(WASM_DATA_DIR)/logfile
touch $(WASM_DATA_DIR)/xlogfile
touch $(WASM_DATA_DIR)/livelog
cp ../sys/libnh/sysconf $(WASM_DATA_DIR)/sysconf
$(WASM_DATA_DIR)/nhdat:
+2
View File
@@ -103,6 +103,8 @@ NHCFLAGS+=-DCOMPRESS=\"/bin/gzip\" -DCOMPRESS_EXTENSION=\".gz\"
#NHCFLAGS+=-DMSGHANDLER
#NHCFLAGS+=-DTTY_TILES_ESCCODES
#NHCFLAGS+=-DTTY_SOUND_ESCCODES
#NHCFLAGS+=-DNO_CHRONICLE
#NHCFLAGS+=-DLIVELOG
CFLAGS+= $(WINCFLAGS) #WINCFLAGS set from multiw-2.370
CFLAGS+= $(NHCFLAGS)
+4 -1
View File
@@ -103,6 +103,8 @@ NHCFLAGS+=-DNOMAIL
#NHCFLAGS+=-DMSGHANDLER
#NHCFLAGS+=-DTTY_TILES_ESCCODES
#NHCFLAGS+=-DTTY_SOUND_ESCCODES
#NHCFLAGS+=-DNO_CHRONICLE
#NHCFLAGS+=-DLIVELOG
CFLAGS+= $(WINCFLAGS) #WINCFLAGS set from multiw-2.370
CFLAGS+= $(NHCFLAGS)
@@ -449,7 +451,7 @@ build_package_root:
sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(PKGROOT_UGLN)/sysconf
cd dat; install -p $(DATNODLB) ../$(PKGROOT_UGLN)
# XXX these files should be somewhere else for good Mac form
touch $(PKGROOT_UGLN)/perm $(PKGROOT_UGLN)/record $(PKGROOT_UGLN)/logfile $(PKGROOT_UGLN)/xlogfile
touch $(PKGROOT_UGLN)/perm $(PKGROOT_UGLN)/record $(PKGROOT_UGLN)/logfile $(PKGROOT_UGLN)/xlogfile $(PKGROOT_UGLN)/livelog
mkdir $(PKGROOT_UGLN)/save
# XXX what about a news file?
@@ -473,6 +475,7 @@ build_package_root:
echo chmod $(VARFILEPERM) $(HACKDIR)/record >> PKGSCRIPTS/postinstall
echo chmod $(VARFILEPERM) $(HACKDIR)/logfile >> PKGSCRIPTS/postinstall
echo chmod $(VARFILEPERM) $(HACKDIR)/xlogfile >> PKGSCRIPTS/postinstall
echo chmod $(VARFILEPERM) $(HACKDIR)/livelog >> PKGSCRIPTS/postinstall
echo chmod $(VARFILEPERM) $(HACKDIR)/sysconf >> PKGSCRIPTS/postinstall
echo chmod $(GAMEPERM) $(SHELLDIR)/nethack >> PKGSCRIPTS/postinstall
echo chmod $(EXEPERM) $(SHELLDIR)/recover >> PKGSCRIPTS/postinstall
+23
View File
@@ -86,6 +86,29 @@ MAXPLAYERS=10
# Maximum number of score file entries to use for random statue names
#MAX_STATUENAME_RANK=10
# Use "Live logging" for important events (achievements, wishes, etc)
# Only available if NetHack was compiled with LIVELOG.
# Only really meaningful for public servers.
# See the log in-game with #chronicle -command.
# Bitmask for kinds of things you want to log - combine the following values
# as desired.
# 0x0000 - No live logging (default)
# 0x0001 - Wishes
# 0x0002 - Significant achievements (complete sokoban, perform invocation, etc)
# 0x0004 - Kill, destroy or bribe a unique monster.
# 0x0008 - Significant religious events (sacrifice gifts, crowning)
# 0x0010 - Life-saving
# 0x0020 - Break conduct - see also LLC_TURNS below.
# 0x0040 - Artifact obtained (#name Sting, dip for Excalibur)
# 0x0080 - Genocides
# 0x0100 - Murder of tame pet
# 0x0200 - Changed alignment temporarily or permanently
# 0x0400 - Log URL for dumplog if ascended
# 0x0800 - Log dumplog url for all games
# 0x1000 - Log 'minor' achievements - can be spammy
# 0x8000 - Livelog debug msgs (currently only 'enter new level')
#LIVELOG=0x1FFF
# Show debugging information originating from these source files.
# Use '*' for all, or list source files separated by spaces.
# Only available if game has been compiled with DEBUG, and can be