feat: Adds housing.bin support (#2329)

### Summary

Changes component verification so the order is now housing.bin, then txt files in client, then txt files in Data/Components folder on the server.
This commit is contained in:
Kamron Batman 2026-02-08 19:10:23 -08:00 committed by GitHub
parent b191498569
commit a9d2b0c01f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 340 additions and 267 deletions

View file

@ -22,7 +22,8 @@ namespace Server;
public static class UOPFiles
{
public static Dictionary<int, UOPEntry> ReadUOPIndexes(
FileStream stream, string fileExt, int entryCount = 0x14000, int expectedVersion = -1, int precision = 8
FileStream stream, string fileExt, int entryCount = 0x14000, int expectedVersion = -1, int precision = 8,
Dictionary<ulong, UOPEntry> additionalHashes = null
)
{
var reader = new BinaryReader(stream);
@ -70,8 +71,12 @@ public static class UOPFiles
var compressed = reader.ReadInt16() == 1;
if (offset != 0 && hashes.TryGetValue(fileNameHash, out var fileIndex) && compressedLength > 0 &&
decompressedLength > 0)
if (offset == 0 || compressedLength <= 0 || decompressedLength <= 0)
{
continue;
}
if (hashes.TryGetValue(fileNameHash, out var fileIndex))
{
entries[fileIndex] = new UOPEntry(offset + headerLength, decompressedLength)
{
@ -79,6 +84,14 @@ public static class UOPFiles
CompressedSize = compressedLength
};
}
else if (additionalHashes != null && additionalHashes.ContainsKey(fileNameHash))
{
additionalHashes[fileNameHash] = new UOPEntry(offset + headerLength, decompressedLength)
{
Compressed = compressed,
CompressedSize = compressedLength
};
}
}
}
while (nextBlock != 0 && nextBlock < length);