Open
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).