Player icon indicating copy to clipboard operation
Player copied to clipboard

Emscripten: provide a way to handle savegame files

Open fdelapena opened this issue 9 years ago • 3 comments

After some testing, I tried to generate a download of a savegame contained in the IndexedDB storage but the file was not properly formatted, something went wrong with file size, though lcf headers were valid. Since Firefox 49 this data can be deleted from the storage inspector, but there is no easy way even for developers to dump this data.

A documented and (hopefully integrated) working way to export these savegames may be useful for us as even for end users to import/export savegames, for testing purposes and for fun.

fdelapena avatar Sep 02 '16 22:09 fdelapena

Some web tool for save management would be an option

Ghabry avatar Sep 02 '16 22:09 Ghabry

Problem is emscripten does some magic to store attributes inside the database field along the real binary blob. Data seems to be vacuumized someway (the files are smaller with empty parts (0x00) left out (at least when you look at the sqlite database Firefox uses). I want to test writing a little tool with http://dexie.org/ to get the data, but no time for now.

What came also to mind is using a c++ executable compiled with emscripten to get the data from the "real" filesystem, but this would need some interfacing to download the files and such.

carstene1ns avatar Sep 11 '16 12:09 carstene1ns

I'm close to getting this working inside our save scene.

Downloading already works.

Uploading gives a corrupted file. Guess I do the memory allocation incorrectly.

Ghabry avatar Feb 14 '22 21:02 Ghabry