Saving a game not working because of minimap.png code

Bug #1209256 reported by Nasenbaer on 2013-08-07
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
widelands
High
cghislai

Bug Description

As long as the option --nozip=false, which is the default value, Widelands shows an error when saving a game.
This is due to the fact, that ZipFIlesystem does not support OpenStreamWrite(). Therefore we need to implement it.

Maybe it would be enough to write the data to a bit field and store it in the ZipFilesystem once closed? (but just brainstorming)

Related branches

Nasenbaer (nasenbaer) wrote :
Changed in widelands:
assignee: nobody → cghislai (charlyghislain)
cghislai (charlyghislain) wrote :

I see there is that zipWriteInFileInZip function that may even allow us to not buffer anything on our side. I will try to see what it gives.

I think the ideal solution would be to only work with zip files as it seems mandatory to share savegames in multiplayer games.
In the meantime the minimap branch has a check to prevent the error to happen.

SirVer (sirver) wrote :

> I think the ideal solution would be to only work with zip files as it seems mandatory to share savegames in multiplayer games.
Having nozip is very useful for debugging at times though.

> This is due to the fact, that ZipFIlesystem does not support OpenStreamWrite().
We should not pretend to stream if we do not do it. The Png code might as well use a block file and write it in one chunk. Implementing Streaming write and then keeping everything in memory is a bad idea imho.

cghislai (charlyghislain) wrote :

I just tried to write directly in the zip using zipWriteInFileInZip and it seems to work as expected.
i commited this to the minizip branch.
I will further test then propose for review this evening.

cghislai (charlyghislain) wrote :

I pushed the stream reader/writer into the minimap branch.
Saving works fine, however it seems the imageloader somehow does not try the zipfilesystem. I will try to figure out that later.

Nasenbaer (nasenbaer) wrote :

Thank you for the bug fix and improvements cghislai. :)
I merged your branch in bzr rev. 6714

Changed in widelands:
status: Confirmed → Fix Committed
SirVer (sirver) wrote :

Released in build-18 rc1.

Changed in widelands:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Bug attachments