Replacing pkzip

Replacing pkzip

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Replacing pkzip

Post by hoijui »

For the base content generation, we zurrently use pkzip on windows, and zip on the other platforms, which is usually installed by default on linux.
The base files are not compatible, as in, you do not sync if some players use the windows genreated ones, and others those made on linux. This can be cause of platform dependent thing, like line endings or case diferences in file names, or possibly the different file archiving tools (less likely).
I had a look at this list:
http://en.wikipedia.org/wiki/Comparison ... _archivers
And the only two free tools, which run on all out platforms and feature command line interfaces, are DAR and Info-Zip:
http://en.wikipedia.org/wiki/DAR_(Disk_Archiver)
http://en.wikipedia.org/wiki/Info-ZIP
maybe using other tools does not help at all, but i though i'd list them here for reference anyway.

i can't think of this as beeing an unsolvable problem, and it coudl save us from some ever returning problems, so it seems worth trying to fix this.
As i have no idea how these files are used, two questions:
wold it be an option to convert all files (and dirs) in these 4 archives to lowercase only? Would it break anything/would a lot have to be adjusted?

If it really is the case sensitivity, could the checksum algorithm maybe force file names that are all on one case to lowercase on windows?
User avatar
thesleepless
Posts: 417
Joined: 24 Oct 2007, 04:49

Re: Replacing pkzip

Post by thesleepless »

7zip/p7zip is available on all platforms for cli
Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Re: Replacing pkzip

Post by Auswaschbar »

Remove pkzip and include wget for autodownload?
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Replacing pkzip

Post by Tobi »

hoijui wrote:case diferences in file names
[...]
wold it be an option to convert all files (and dirs) in these 4 archives to lowercase only? Would it break anything/would a lot have to be adjusted?

If it really is the case sensitivity, could the checksum algorithm maybe force file names that are all on one case to lowercase on windows?
Filenames are already checksummed in lowercase, see ArchiveScanner.cpp:529-545.

EDIT: Also have you already checked the archives have the same contents? It wouldn't suprise me if the .bat is just outdated a bit and forgets to include a directory or two.
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: Replacing pkzip

Post by imbaczek »

better use 7z both on windows and other platforms. also, figure out if/how ctime/mtime/atime affect crc (if it is used at all) and molest with touch if needed.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Replacing pkzip

Post by Tobi »

Times do not affect CRC.

Only lowercased filename and file's CRC (of the files inside the archive) affect CRC.

So the only thing that can be an issue is: the set of files that is put in the archives isn't same on windows and linux, or the contents of the files isn't the same on windows and linux (may be line endings.)

Again, see ArchiveScanner.cpp:529-545.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Replacing pkzip

Post by zwzsg »

hoijui wrote:The base files are not compatible, as in, you do not sync if some players use the windows genreated ones, and others those made on linux.
I used to play fine, without desync, against people using Linux. What changed? Does the problem exist in the first place?
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Replacing pkzip

Post by Tobi »

Only for people building their own Spring on Windows, which they want to use in multi player, it may be a problem.

(And even then it is a minor one as they can just get the release base files, or, in case of a development version, the base files from BuildServ.)
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Replacing pkzip

Post by hoijui »

thanks tobi!
ther is indeed one file that is missing on windows (EngineOptions.lua).
i already fixed that locally, but did nto commit it yet (since 2 weeks or so :/ ). but even with that, it did not sync. though .. i dont trust my ols ego (as of 2 weeks ago.. actually not even the one from an hour ago mostly, but that is not importat here..). so ill commit and test again, and then will try with 7zip instead of zip/pkzip.
Post Reply

Return to “Engine”