Repository navigation
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.
Cloud saves: ask the player which save wins, and wait for a listed iCloud save to download #2180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Cloud saves: ask the player which save wins, and wait for a listed iCloud save to download #2180
Changes from all commits
bb88fcfFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
…loud save to download Both launchers read the cloud's save before Play. When the save changed on both this device and the cloud, they show both with their dates and device and set DM_SAVE_SYNC_CHOICE from the player's pick, instead of the newer file date winning. A save started fresh a minute after a real one has the later date and none of the progress: on Cadence of Hyrule the phone's new slot, saved 45 s after the Mac's, replaced a 54-minute save in the cloud, which survived only in the phone's save-backups. The second symptom is iCloud: a save it has only listed (.save.dmsync.icloud) could come back empty from the coordinated read, so the first start played this device's save and the second, after the download landed, brought the cloud's in. dm/host/save_sync.{h,c}: save_sync_report() answers one key=value line about both saves (hash, newest date, file count, device), the sync base and whether both changed, fetching the cloud's save through the same front-end call the mount uses; dm_save_sync_title_id() gives a launcher the title ID the host was built for. FETCH_MS 10 s -> 20 s, since what it waits on is an iCloud download. dm/ios/Sources/SaveSync.m: front_save_sync_fetch asks for a save iCloud has only listed and waits up to 25 s for the file itself before the coordinated read, logging how long it took; a read that still fails stays -1, which the host treats as unreadable (it plays this device's save and sends nothing), so a slow iCloud never replaces the cloud's progress. dm/ios/Sources/Launcher.swift and dm/mac/Launcher.swift: the report runs off the main thread when Play is pressed; on a conflict a confirmationDialog (iPhone) or an NSAlert (Mac) offers this device's save, the cloud's, or Cancel, and sets DM_SAVE_SYNC_CHOICE=local:<hash> or cloud:<hash>; with no conflict it sets ask. A report that could not be read leaves the choice unset, because ask without a comparison keeps the cloud's save out of the session. Both read DM_SAVE with getenv: ProcessInfo's environment is a snapshot from before env.txt and the saved choices are applied. The iPhone shows "Checking the cloud save…" while the report waits. dm/host/tests/t_save_sync.c: section 15, the report's states (nothing anywhere, only here, in step, only in the cloud, both changed with the cloud's date newer, the cloud unreadable, sync off). Front-ends: new: save_sync_report(save, cloud_file, title, out, n) and dm_save_sync_title_id() in dm/host/save_sync.h — the line a launcher reads to ask before it starts the game Front-ends: interface: DM_SAVE_SYNC_CHOICE=ask must be set only after a successful report; set blind, it keeps the cloud's save out of the session and sends nothing Checked: make -C dm/host/tests GAME=0100000000010000 run (all pass; save sync 96 checks, metadata 41); Cadence of Hyrule 01000B900D8B0000 1.5.0 on an iPhone (iPhone19,4) and a Mac mini M2 Pro, macOS 26.6: both saves' dates shown on Play, the cloud choice brought the Mac's save in and the phone's was kept in save-backups, and a start with no conflict played as before. The iCloud wait was checked with a planted .save.dmsync.icloud in a scratch folder (DM_LAUNCHER=0): the host gave up at 20 s, the front end at 25 s, nothing written.Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
Check failure on line 580 in dm/host/save_sync.c
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.