Closed bodograumann closed 2 years ago
Thanks for investigating this. Are you sure that the hook isn't run for the leaderboard files? There isn't any filtering code, it should copy over any json file saved to the game's data location.
However you are right that copying over all the files immediately isn't actually necessary and I can probably replace that with only creating the parent directory and letting files get saved with updates. The only potential issue is that some files may not be kept if the game isn't played much but that seems to be smaller than the number of cases where restored manual files are being overwritten with blanks due to ordering issues
Pretty sure about what I found. Tested multiple times and even after removing the empty backed up files, they are not saved via the hook. Maybe for those files a new method is used in 1.24 instead of SaveToJSONFile. Not sure how to tell though.
You're right, it uses a different method to save the JSON for some reason. I'll add a hook to catch them as well
My local scores where getting lost. I had to search for quite a while to find the root cause of this issue. To reproduce:
ModData/com.beatgames.beatsaber/Mods/datakeeper
. Including (potentially empty)LocalLeaderboards.dat
andLocalDailyLeaderboards.dat
.PlayerData.dat
andsettings.cfg
. It is not called for the leaderboard files however!Workaround: Manually delete
LocalLeaderboards.dat
andLocalDailyLeaderboards.dat
from the backup location.I think simply not copying all the files when initially creating the backup folder in setup(), would prevent the issue from occuring. Though backing up the scores correctly was probably intended and a more involved fix is needed.
This is with game version 1.24.0