The cliloc files, are loaded in their entirety into Bwt and written back out. This was easy, like 10 minutes effort. The gumpartLegacyMUL.uop was much more complex to work out, and took me about 15 hours of effort to get right. The file structure is as follows:
uInt32 : MagicNumber
uInt32 : Version
uInt32 : timestamp
Int64 : NextBlockAddress
uInt32: Block Size
Int32: Total file count
---Seek to NextBlockAddress location---
From this point, the file is split into chunks of "Block Size". Previously 1000, now 100.
---Loop through chunks---
Int32: fileCount in chunk
Int64: Next Chunk Address
---Loop through files---
Int64: File data offset
Int32: Header length
Int32: Size of data compressed
Int32: Size of data decompressed
UInt64: hash (of the filename, so the client can do lookups)
UInt32: Data hash (not used here)
Int16: Flag (THIS: is the decompression level. 0/1: None, 2: Normal ZLib, 3: New BWT method)
---Save current file position, and point buffer to file data offset---
byte[]: Read HeaderLength
byte[]: Read Compressed Data Length
---Point buffer back to last position---
---end loop---
---Seek next Chunk---
---end loop---
Patch UO:2D by running UOPatch.exe, this will download the latest file.
Move all these files from the build into the UO Directory. Ideally I'll get this compiled into a single file executable for cleanliness.
Run Back2Britain.exe.
This will move all cliloc.* files into backup and gumpartLegacyMUL.uop into the backup folder. Then process the files and create new decompressed files.
New Files will run with : Orion/UOFiddler/CUO (perhaps more)
https://buymeacoffee.com/adverserath Or even just say thanks on Discord: adverserath