-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Gamebook Library Cloud Backups #34
Comments
I was curious how NetNewsWire handles iCloud syncing and it looks like it uses CloudKit https://github.com/Ranchero-Software/NetNewsWire/tree/main/Account/Sources/Account/CloudKit Wonder if their implementation is the most straightforward way to implement CloudKit. Since GBE is already using core data in a fairly standard way, maybe using CloudKit for database syncing wouldn't be a big deal... only one way to find out I guess... Docs: https://developer.apple.com/documentation/coredata/mirroring_a_core_data_store_with_cloudkit |
Doesn't look like the core data store in GBE has any problem with CloudKit requirements: https://developer.apple.com/documentation/coredata/mirroring_a_core_data_store_with_cloudkit/creating_a_core_data_model_for_cloudkit#3191035 |
Doesn't seem like it would be all that difficult. And once the database gets into iCloud, we could write a web app. Now, that said, users need to be able to opt-in to this, not opt-out, as I do promote the privacy and disconnectedness of Gamebook Engine. I assume I should be able to set it up that way. |
Got blocked trying to generate a CloudKit schema.
This might not be a big blocker. Pages don't need to be ordered in a game, literally no reason for that. And decisions... well... ordering seems like it might be important there though there is currently no way to actually reorder decisions on a page. If we want to keep ordered decisions, we can implement a "default value" is interesting, I wonder if default value can be an actual UUID in those cases. The other things have in-code defaults really. And then the optional relationship thing... I mean... if an attribute doesn't have a game, if a consequence doesn't have a page, that's just bad data. But maybe it's not a big deal to consider those things optional. Schema changes does mean migrations but maybe it's not a big deal... |
Another possibility is to set up a second core data store just to support syncing. Model would be super simple, local_uuid, game_json (the export of the game), sync_timestamp, and date_updated. I think with that we'd have enough to set up a decent document-based sync system. |
This doesn't have to be the solution--because I quite like my last comment's idea of essentially a document store using CloudKit--but taking that idea even further, does it not seem like Gamebook Engine could be something a bit more like, say, Pages? A productivity app? In the sense that it's acting on files. The fact that I'm loading the games into a database on the device and playing them off of that is an implementation detail. In reality it would make more sense if gamebooks lived in a Gamebook Engine specific folder in your documents or on your phone some where and you used gamebook engine to open them. But I guess that interface is kind of lame deep down. There's no reason it can't work that way, though. In reality Gamebook Engine is more like Books.app, where you drag files into it and then it does some hoodoo and changes the files all up into something it likes more and creates a database and syncs it to the cloud in its own way and so on. |
Idea of a document store backup is winning in my mind. And it should be essentially one-way where by default your books are uploaded to the sync database whenever they change, but it's not an automatic two-way sync. You can choose to overwrite your local book store with what is in the cloud if you want, but it's not going to overwrite a game while you're playing it. I was really overthinking the issue for a bit there. |
It would be nice if users could opt-in to storing their gamebook libraries securely in iCloud somehow. Maybe I can build something really simple like a mass export to a folder in iCloud. Or go all out and use CloudKit to store the Core Data DB in the cloud...? Maybe a little kooky but that would be the coolest.
It goes without saying it's important this cloud backup use iCloud for security and privacy purposes.
The text was updated successfully, but these errors were encountered: