Repository navigation
Windows front end: the cloud-saves patch adds save_sync.c to the Makefile SRC - #190
Merged
Merged
Conversation
…through an iCloud Drive folder Until now a save moved between the Mac and an iPhone only by hand (the Mac front end's Saves sheet, over the cable). The apps are signed ad hoc or with a free/personal team, so CloudKit and iCloud entitlements are out; a folder the player picks in iCloud Drive is not. dm/host/save_sync.c packs the committed save (DM_SAVE and DM_SAVE_device) into one file, <folder>/<title ID>/save.dmsync (a folder named after the title ID is taken as the game's own), because iCloud replaces a file as a whole but syncs a folder file by file. The cloud's copy comes in at the game's first save mount, before the work directory is cloned; the committed save goes out a few seconds after a Commit on a thread of its own, when the iPhone app goes to the background, and from the Mac launcher once the host has exited. <DM_SAVE>.sync keeps the hash of the save last known to be the same on both sides: only the cloud's changed, it comes in; only this one changed, it goes out; both changed, the newer wins. Every save this replaces, here or in the cloud, is kept first in <DM_SAVE>-backups/<date> local|cloud. The folder is chosen in each app's launcher: Cloud saves in the Mac settings window (dm/mac/Launcher.swift, defaults key cloudSaves.folder, read by launcher.c) and on the iPhone (a security-scoped bookmark, DataBookmark.m). DM_SAVE_SYNC (a folder, icloud, or 0) overrides both. On the iPhone the copies go through NSFileCoordinator (SaveSync.m), which downloads a file iCloud has only listed. Tested: dm/host/tests/t_save_sync.c (47 checks, also under TSan and ASan/UBSan), and TOTK 1.4.3 between an iPhone and a Mac in both directions.
Exported with scripts/patches.py export; patches.py check passes (20 patches on seedds/nxnative 062cd06 give the committed vendored tree).
…file SRC The Windows front end mirrors dm/host/Makefile's SRC line to know what to compile for its own host build, and its test compares the two — the cloud- saves patch (#185) added save_sync.c to the Makefile but not to the mirror, so the Qt suite failed. Both lists updated.
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Stacked on #185: the cloud-saves patch adds
save_sync.ctodm/host/Makefile's SRC line, andfrontend-qt/nspb_qt/win/build_app.pymirrors that list — its test compares the two, which is why #185's Qt job failed. Both mirror lines updated (WANT_SRC and host_sources).If #185 merges first, this reduces to the one file; retarget as needed.