Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old January 14, 2020, 02:13   #1
lea2501
Apprentice
 
Join Date: Dec 2019
Posts: 61
lea2501 is on a distinguished road
Lightbulb Ideas on how to save and quit after a time without activity

This is maybe a weird question, but i wanted to ask for ideas about how i can save and quit the game after, lets say, some minutes of inactivity.

I sync the savegame across two of my computers, at two different places (place A and place B) where i usually stay, the thing is that if i left by accident the game opened without exiting in place A, when i arrive to place B, i don't have my savegame updated (for better or for worse sometimes) so i don't play until i return to place A and continue the game there, remembering to exit so it saves and syncs to place B.

So i was wondering, its maybe an easy way to bash script or something like that, some sort of timeout so if i don't enter any command or touch the keyboard, it sends the exit command to the game so that it saves where i left? for when i arribe to place B, the timeout period finished and the game exited and saved wihout my interaction, and i can continue to play at place B?

I know that maybe its better to ssh to one of the computers or something like that, but i don't have the two connected 24/7 every time, and i like to sync them when both are up and running and don't depend on having the one in the other place available when i need.

Lol, thanks in advance!
lea2501 is offline   Reply With Quote
Old January 14, 2020, 02:57   #2
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 6,856
Donated: $40
Pete Mack will become famous soon enough
You'd need a code change.

There are two ways to do it. The first way requires replacing the blocking read with a timeout read for input. Set the timeout to whatever interval you want, and do a save game followed by exit when it is reached.

The second is to make the code multi-threaded, so there is a thread that wakes up every X seconds to check for activity. It'd do the same thing, while the main thread updates a clock every time there is activity.
Pete Mack is online now   Reply With Quote
Old January 14, 2020, 03:18   #3
lea2501
Apprentice
 
Join Date: Dec 2019
Posts: 61
lea2501 is on a distinguished road
Quote:
Originally Posted by Pete Mack View Post
You'd need a code change.

There are two ways to do it. The first way requires replacing the blocking read with a timeout read for input. Set the timeout to whatever interval you want, and do a save game followed by exit when it is reached.

The second is to make the code multi-threaded, so there is a thread that wakes up every X seconds to check for activity. It'd do the same thing, while the main thread updates a clock every time there is activity.
Thanks for answering... I was thinking something more like a bash script that launch the game and also check for inactivity, or force quit the game if the timeout takes place, i remember some time ago, i force quitted the terminal where the game was running and i didn't lost the progress, so i think that maybe its possible to have a "timeout" command that sends the kill signal to the game.
lea2501 is offline   Reply With Quote
Reply

Tags
savegames, sync


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Z/OS port? Hey! Quit laughing! gglibertine Vanilla 7 November 20, 2015 16:47
2013 Roguelike world activity survey, please participate! slash Idle chatter 0 February 5, 2014 03:01
[FA] A few ideas, comments from a 1st time player taptap Variants 21 January 3, 2014 21:14
can't load save file. anti-save scumming feature? unbuttered_toast Vanilla 4 May 21, 2010 17:57
Should I quit? g. rodrigues Vanilla 6 February 5, 2008 20:01


All times are GMT +1. The time now is 15:28.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.