feat(world): record the zone files a world loads, with sizes and hashes

ZoneFileLog keeps the .luz, .lvl, .lutriggers, terrain .raw and navmesh a
world read while loading its zone: absolute path of the loose file (or
the name in the pack), size and an FNV-1a hash of the bytes read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-30 02:44:08 -05:00
parent b629766182
commit e709855b7d
8 changed files with 165 additions and 0 deletions

View File

@@ -154,6 +154,17 @@ bool AssetManager::GetFile(std::string fixedName, char** data, uint32_t* len) co
return success;
}
std::optional<std::filesystem::path> AssetManager::GetLoosePath(std::string fixedName) const {
// The same name fixing as GetFile
std::transform(fixedName.begin(), fixedName.end(), fixedName.begin(), [](uint8_t c) { return std::tolower(c); });
std::replace(fixedName.begin(), fixedName.end(), '\\', '/');
if (this->m_AssetBundleType == eAssetBundleType::Unpacked) GeneralUtils::ReplaceInString(fixedName, "brickmodels", "BrickModels");
const auto path = m_ResPath / fixedName;
std::error_code code;
if (!std::filesystem::exists(path, code)) return std::nullopt;
return path;
}
AssetStream AssetManager::GetFile(const char* name) const {
char* buf; uint32_t len;