Page 1 of 1

simple git sync feature to enable save syncing

Posted: 05 Aug 2021, 08:30
by CallOfDevops
basically, if you could configure so that when you hit the save button that you could optionally have a trigger that does a git sync to your save repository that you set up. while that trigger is enabled, when you press the load game button, it would also do a git sync to check for the latest edition of the save file from your repo.

basically just kind of add this basic function to the save game and load game function.....should be as simple as something like this :

Code: Select all

def savegame():

   if $GIT_SAVE_SYNC = true:
      run {git sync on {$SAVE_FILE_FOLDER}}
   else:
      continue
and

Code: Select all

def loadGame():

   if $GIT_SAVE_SYNC = true:
      run {git sync on {$SAVE_FILE_FOLDER}}
   else:
      continue
i imagine that the picture for the save file should be excluded from git commits to avoid sending too many binary blobs.
this would be such an amazing feature, allowing mobile and pc and whatever to easily sync.

~~ I jumped the gun and posted to the gitlab first.. and was told to post this here, I'd love to know what you guys think of this idea? https://gitlab.com/OpenMW/openmw/-/issues/6203

Re: simple git sync feature to enable save syncing

Posted: 09 Aug 2021, 00:10
by wazabear
Every OS has some software available for a macro, you could just set up a hotkey that runs that git script and bind it to your quicksave key :)

To deal with hard saves and autosaves you could wrap the entire application in a script and run the command when game exits, should just be a few line bash or python script.

It's not perfect but unfortunately this is going to be only way to do it since Lua is too restrictive. Either that or use a directory sync, the easiest option, and probably the best one.

Re: simple git sync feature to enable save syncing

Posted: 09 Aug 2021, 11:56
by psi29a
tbh, just run a script every 5 minutes that does the same thing. You don't have to wait for a program to exist. The only thing you could do, is just have teh script check if the program is running and then not run a backup... as in, only run the backup when the game isn't running. Then you don't have to do anything fancy around the application.