-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
Serialize all save slots and deserialize them without loading a specific slot #305
Comments
Unless I'm mistaken, this is already part of |
Thanks for quick reply. |
Yes. Check out the documentation on |
Oh i figured out. Yes the import/export can backup/restore all the slots to/from a save file. But unfortunately, what i need is a JSON string so that i can SELECT/INSERT/UPDATE it in postgresSQL easily. I guess I should create my own save/load function instead of using the brower save API, so that I can set/get the JSON string I want to/from localStorage and do something before loading. |
I suppose I could add |
Made some changes:
The latter two are what you should need. |
Great! Thanks a lot. I'll try it soon. |
Is your feature request related to a problem?
I'm working on a game with cloud save feature based on Supabase database. The process in my plan should be like:
:: Start
User login with useid and password. If successd, goto :: LoadGame
:: LoadGame
The problem is that serialize/deserialize feature only works on the current slot. And a load will be immediately processed after deserialize.
Describe the solution you'd like.
Save.serializeAll(): Return a JSON string like: {"slot0":"Slot 0 Serialized String","slot1":"Slot 1 Serialized String","slot2":"Slot 2 Serialized String"}
Save.deserializeAll(string): Deserializes the given save string created via Save.serializeAll() and cover the current localStorage.
Describe alternatives you've considered.
Maybe some other solutions using the current Serialization API?
Additional context.
Nope.
The text was updated successfully, but these errors were encountered: