Skip to content

Commit

Permalink
Do not generate dumplog if game was startscummed.
Browse files Browse the repository at this point in the history
If the player quits or escapes within 100 turns or less, the dumplog
files (.txt and .html) are not generated. This is done to combat serial
startscummers from generating huge amounts of junk dumplog files. Saves
volume space and is a bit less load on the server.

This currently prevents dump_open_log() from executing, and guards
against dump_close_log(). Potential for improvement here possibly.

Co-authored-by: entrez <[email protected]>
  • Loading branch information
k21971 and entrez committed Nov 13, 2024
1 parent 61106eb commit c3f35e0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/end.c
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,7 @@ int how;
boolean taken;
char pbuf[BUFSZ];
winid endwin = WIN_ERR;
boolean bones_ok, have_windows = iflags.window_inited;
boolean bones_ok, have_windows = iflags.window_inited, startscummed;
struct obj *corpse = (struct obj *) 0;
time_t endtime;
long umoney;
Expand Down Expand Up @@ -1308,7 +1308,11 @@ int how;
#endif
/* END TNNT code */

dump_open_log(endtime);
/* Don't produce a dumplog for scummed games */
startscummed = ((how == QUIT || how == ESCAPED) && moves <= 100L);

if (!startscummed)
dump_open_log(endtime);
/* Sometimes you die on the first move. Life's not fair.
* On those rare occasions you get hosed immediately, go out
* smiling... :-) -3.
Expand Down Expand Up @@ -1683,7 +1687,8 @@ int how;
if (endwin != WIN_ERR)
destroy_nhwindow(endwin);

dump_close_log();
if (!startscummed)
dump_close_log();
/* "So when I die, the first thing I will see in Heaven is a
* score list?" */
if (have_windows && !iflags.toptenwin)
Expand Down

0 comments on commit c3f35e0

Please sign in to comment.