Store all savedata in one zip-file for each ROM
-
Hello again,
there was a small discussion how to get multi-user support with savegamestates. Out of this I see a method to extract and to create zip files for all savestates that were created by the game itself (battery sav, srm...) or libretro (autosaves... romname.auto.state, romname.state?...)
First we need to install zip support
sudo apt install zip
I tested these batchfiles and they are working flawless
Add this to runcommand-onend.sh
#!/bin/bash # Merge Savegames of called ROM in one zip file # cyperghost 08/22/2017 rompath="${3%/*}" romname="${3##*/}" data="${3##*.}" cd "$rompath" && zip --exclude=*.$data* -mj "savestates_${romname%.*}.ZiP" "${romname%.*}".*
Add this to runcommand-onstart.sh
#!/bin/bash # Extract Savegames of called ROM out of zip file # cyperghost 08/22/2017 rompath="${3%/*}" romname="${3##*/}" cd "$rompath" && unzip -qq -o "savestates_${romname%.*}.ZiP"
So for ex. Terranigma with 1 SRM and 3 Autostates (in total 15MB) will merge to just 0,4MB ;)
As small bonus the files are named
savestates_ROMNAME.ZiP
so all savegames are listed by letter s ;)Out if this: May I can get help with the exclude command? I solved it ... but I'm not satisfied with that! I read out ROMs filesuffix and exclude it. The ROMNAME itself won't work!
I used parameters
rompath
andromname
just as hint what happens by using zip and unzip as self explaining variables. The bash files can be merged to one liners... on a later state :DPS: The community is great!
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.