widelands does not accept zipped maps with name != dirname
Bug #536189 reported by
Nasenbaer
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
widelands |
Fix Released
|
High
|
Timowi |
Bug Description
Current Widelands engine can only read zipped files, if the first directory inside the zip is exactly named like the zip file.
So for example if the top directory of a map is DFT.wmf, the zip file must be named DFT.wmf as well, else widelands won't accept the file.
This can be seen as bug, as the map files can't be renamed by the user without making it unusable
Related branches
lp:~timo-wingender/widelands/fix-loading-zipfiles
- SirVer: Approve
- Nasenbaer: Approve
-
Diff: 247 lines (+53/-41)3 files modifiedChangeLog (+3/-0)
src/io/filesystem/zip_filesystem.cc (+46/-41)
src/io/filesystem/zip_filesystem.h (+4/-0)
Changed in widelands: | |
status: | New → Confirmed |
tags: | added: savegame |
Changed in widelands: | |
status: | Opinion → In Progress |
assignee: | nobody → Timowi (timo-wingender) |
Changed in widelands: | |
status: | In Progress → Fix Committed |
To post a comment you must log in.
This is a annoying bug. This affects every zipped file; savegames and maps.
The problem is the redundancy in the zip files: the directory name is saved in the filename and as the folder name inside the zip. How should this be fixed? Which string should be taken? How should new zip files saved?
I think the cleanest solution is to store the content directly in the root of zip files and only take the zip file name as path. For old files the first directory must be stripped away then. This throws the redundancy away completely and this is the way how most zip files are (as far as I know). But this has one disadvantage: Files saved with releases after the change cannot be opened with versions before the change.
A dirty but more compatible solutions is to keep the structure as it is but ignore the directory name while reading zip files. I personally do not like the idea of saving this redundancy just to ignore it later.
I solution in between could be to implement the reading changes first (possibility to load files with directory name or files with content in the root of the zip) and change the storing functions one or two releases later.
opinions?