PAK files and endianness
#1
I have just realized, when trying to update the information on PAK format in the wiki, that there's a fundamental flaw in the format design. It doesn't take endianness into account at all. When reading and writing the number of chunks and the chunk header, no endianness conversions are performed, meaning that a file saved on one platform is unusable on another platform.

Traditionally, MCServer has been used on Intel, so we probably could declare that it uses little-endian formatting, and fix the code to that. What do you think?
Reply
Thanks given by:
#2
If it gives more compatibility - sure, why not?Tongue
Reply
Thanks given by:
#3
Isn't the pak format deprecated?

Why not leave it as it is for the moment, and set anvil as the default saving scheme
Reply
Thanks given by:
#4
It does not, necessarily - if anyone's using PAK files on a big-endian platform (older Macs, I think ARM is big-endian, too), they will lose their worlds with such a change.
PAK is actually the default now (if you don't set [Storage].Schema or set it to "Default", PAK is used)
Reply
Thanks given by:
#5
Why would they lose their worlds? I'm talking about NO change, only set the default saving to Anvil. If they already have a world, that world's saving scheme is set to PAK, and that won't change by changing the default scheme.
Reply
Thanks given by:
#6
The first half was an answer to Luksor - if we changed the PAK format to be forcefully little-endian, gyus on big-endian platforms would lose their worlds, since their PAK files couldn't be read by the server anymore.

Of course, setting the default storage to Anvil is pretty harmless, but it still doesn't solve the issue of incompatible PAK files across platforms.

Do we want to say that PAK is so deprecated that we won't fix this? Smile
Reply
Thanks given by:
#7
I think changing the default to Anvil is much better idea. MCServer will be compatible with vanilla by default and you don't need to deal with endianness.Tongue
Reply
Thanks given by:
#8
(06-10-2012, 09:24 PM)xoft Wrote: Do we want to say that PAK is so deprecated that we won't fix this? Smile

Yes, let's not support formats that have no benefits over Anvil, and nobody is gonna use now anyway
Reply
Thanks given by: Taugeshtu




Users browsing this thread: 1 Guest(s)