add option idlecheckpoint

New experimental option

This requires platform support to be useful. Currently an
implementation for Windows TTY console is included.

A Unix TTY implementation should be achievable I would think,
but I haven't pursued that, at least not yet (contributions welcome).
I'm not sure whether Qt or X11 interfaces offer a similar
timeout capability..

How it works:

When idlecheckpoint in on, if the wait for a new input is idle for
10 seconds (length of time to waite is controlled by
IDLECHECKPOINT_WAIT_TIME #define in hack.h), save_currentstate() is
called to bring everything up-to-date should a hangup or crash occur.
The input wait then continues/resumes.

The save_currentstate() call is only executed once per input request.
This commit is contained in:
nhmall
2026-04-27 19:22:04 -04:00
parent b7f66f9723
commit a090ba90a1
8 changed files with 92 additions and 33 deletions
+2
View File
@@ -246,6 +246,8 @@ struct instance_flags {
* to input becoming taken over);
* True => enable fuzzer when entering moveloop */
boolean herecmd_menu; /* use menu when mouseclick on yourself */
boolean idlecheckpoint; /* platform should perform a checkpoint update
* if waiting for input longer than 10 seconds */
boolean invis_goldsym; /* gold symbol is ' '? */
boolean in_lua; /* executing a lua script */
boolean lua_testing; /* doing lua tests */