Skip to content

Conversation

@aoeixsz4
Copy link

Currently dgamelaunch checks the mtime of the ttyrec to determine idle time of games for the watching games menu.
Some games continue to update the screen while the user is idle (e.g. NetHack-setseed with realtime UI-clock enabled on the status bar), which results in idle games being displayed as active.

This PR introduces an additional file in the inprogressdir, which is the same as the lockfile path but with '.in' appended.
Any user input is copied live to this file.
The watch menu checks the mtime of this file instead, to show the idle timer for a given game.
Additional routines were implemented to clean up this extra file, and to exclude it from being treated as a lockfile.
This is because currently all files in inprogressdir are treated as lockfiles. With this PR, those ending in '.in' are excluded, and also removed if they are orphans (if the same file without the '.in' suffix does not exist, they are considered orphans).

aoeixsz4 added 2 commits July 30, 2021 05:59
Place additional file in the inprogressdir, same format but with
'.in' appended. User input is written to this file, so its modify time
updates when the user is playing.
Next, calculate idle_time based on the '.in' file instead of the ttyrec.
Add some checks to the code handling lockfiles in inprogressdir, to
ignore '.in' files that should be there and unlink orphaned ones.

squashed commits:
move input tracking file to inprogressdir
remove inputrec file on game exit
remove stale .in files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant