Closed beingretrogamer closed 1 month ago
V8 do this automatically, it saves state in jsdos cloud if user is logged in, otherwise state is stored in indexed db of browser. Just do not forget to press save icon.
Thanks for the quick response. The thing is I am on the kiosk mode and am interested in implementing the auto saves. Is that supported that way? Can we expose the function being called when the user clicks in the normal mode?
On Sat, 24 Aug 2024 at 4:59 AM, Alexander Guryanov @.***> wrote:
V8 do this automatically, it saves state in jsdos cloud if user is logged in, otherwise state is stored in indexed db of browser. Just do not forget to press save icon.
— Reply to this email directly, view it on GitHub https://github.com/caiiiycuk/js-dos/issues/337#issuecomment-2307922599, or unsubscribe https://github.com/notifications/unsubscribe-auth/BIEQGPZPZWRLFB2CE5BTSNDZS7AVTAVCNFSM6AAAAABNBADPV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBXHEZDENJZHE . You are receiving this because you authored the thread.Message ID: @.***>
Kiosk mode is harder, cause saves also use login information. If you can't activate normal mode (e.g. some ui that toggles it), then you need implement it by you own using CommandInterface instance.
Too bad! Do you mind sharing a quick snippet for reference?
Also, please point me to the file where saving happens. I would be happy to contribute this if you feel like it is feasible.
Thanks!
On Sat, 24 Aug 2024 at 5:07 AM, Alexander Guryanov @.***> wrote:
Kiosk mode is harder, cause saves also use login information. If you can't activate normal mode (e.g. some ui that toggles it), then you need implement it by you own using CommandInterface instance.
— Reply to this email directly, view it on GitHub https://github.com/caiiiycuk/js-dos/issues/337#issuecomment-2307927648, or unsubscribe https://github.com/notifications/unsubscribe-auth/BIEQGPY64BZVZQD4A4RLJLLZS7BVPAVCNFSM6AAAAABNBADPV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBXHEZDONRUHA . You are receiving this because you authored the thread.Message ID: @.***>
If you doesn't care about login stuff, I can expose the api method to trigger save code path. It will store only in indexed db
Yep that would do the trick. Would it be a async method? Maybe return entire save state?
On Sat, 24 Aug 2024 at 5:33 AM, Alexander Guryanov @.***> wrote:
If you doesn't care about login stuff, I can expose the api method to trigger save code path. It will store only in indexed db
— Reply to this email directly, view it on GitHub https://github.com/caiiiycuk/js-dos/issues/337#issuecomment-2307940370, or unsubscribe https://github.com/notifications/unsubscribe-auth/BIEQGP3KQ5FO6J66GMI3NF3ZS7EVZAVCNFSM6AAAAABNBADPV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBXHE2DAMZXGA . You are receiving this because you authored the thread.Message ID: @.***>
Hey there! Just checking in if there is any update on this one?
Added in v8.1.19, example:
cost props = Dos(elem, options);
props.save(); // will trigger save function, it return Promise<boolean>
documentation: https://js-dos.com/player-api.html#dosprops
I am able to save the state and it adds an entry in indexedDB. Just after saving, I am retrieving the save data and converting it into a file to be stored locally. Now, how do I load the file before the game starts? I mean there is no load method and I tried initFs and it doesn't seem to work. The only thing that works is if I create an entry the indexedDB like below -
objectStore.add(_result, 'https://storage.yandexcloud.net/doszone-uploads/personal-v2/dzapi/guest/' + bundleName);
_result
is my ArrayBuffer
but this is not very intuitive from the api perspective due to
My 2 cents -
Let me know what are your thoughts! Again, I would be happy to contribute if you feel like this makes sense.
Thanks!
I think you missunderstood the idea of js-dos project. js-dos player is built to run jsdos bundles in web, it works like a blackbox you provide bundle and it manages everything including save/load functions. This new api is made in case when you use kiosk mode, you call the save method and player will save progress same as when you press save button in UI. The loading happen automatically by player itself, it works while you use same url.
There are two options:
Hi @caiiiycuk hope you are doing good. Do you mind sharing a quick example on how can I save the games locally. And then upload the state to continue? Is this even possible in v8?
Thanks!