Skip to content

Commit

Permalink
Suppress livelogging whilst in explore mode.
Browse files Browse the repository at this point in the history
From EvilHack commit c6950ab.
  • Loading branch information
k21971 committed Nov 20, 2024
1 parent 3b9a5d9 commit 31c5191
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/files.c
Original file line number Diff line number Diff line change
Expand Up @@ -4735,15 +4735,21 @@ const char *buffer;
#define LLOG_SEP '\t' /* livelog field separator */
FILE* livelogfile;

if(!(ll_type & sysopt.livelog)) return;
if((ll_type == LL_CONDUCT) && (moves < sysopt.ll_conduct_turns)) return;
if(lock_file(LIVELOGFILE, SCOREPREFIX, 10)) {
if(!(livelogfile = fopen_datafile(LIVELOGFILE, "a", SCOREPREFIX))) {
if (!(ll_type & sysopt.livelog))
return;
if ((ll_type == LL_CONDUCT)
&& (moves < sysopt.ll_conduct_turns))
return;
if (discover) /* don't livelog in explore mode */
return;
if (lock_file(LIVELOGFILE, SCOREPREFIX, 10)) {
if (!(livelogfile = fopen_datafile(LIVELOGFILE, "a", SCOREPREFIX))) {
pline("Cannot open live log file!");
} else {
char tmpbuf[1024+1];
char msgbuf[512+1];
char *c1 = msgbuf;

strncpy(msgbuf, buffer, 512);
msgbuf[512] = '\0';
while (*c1 != '\0') {
Expand All @@ -4766,9 +4772,9 @@ const char *buffer;
moves,
LLOG_SEP,
urealtime.realtime + (getnow() - urealtime.start_timing), LLOG_SEP,
(long)ubirthday,
(long) ubirthday,
LLOG_SEP,
(long)time(NULL),
(long) time(NULL),
LLOG_SEP,
msgbuf);

Expand Down

0 comments on commit 31c5191

Please sign in to comment.