diff --git a/Engine/Game/World/custom_level_manifest.cpp b/Engine/Game/World/custom_level_manifest.cpp index fb87f2a..782b0d2 100644 --- a/Engine/Game/World/custom_level_manifest.cpp +++ b/Engine/Game/World/custom_level_manifest.cpp @@ -86,9 +86,9 @@ void exact_fields(const Json& object, std::initializer_list ex CustomLevelManifest parse(std::string_view text) { if (text.size() > custom_level_manifest_max_bytes) throw std::runtime_error("custom-level manifest exceeds 64 KiB"); - if (text.starts_with("\xef\xbb\xbf")) - throw std::runtime_error("custom-level manifest must not contain a UTF-8 BOM"); + // Json::parse skips a byte-order mark, which several Windows editors still + // write. The launcher and the server accept one, so the game must too. const auto root = Json::parse(text, JsonLimits{ custom_level_manifest_max_bytes, 8, 8192}); exact_fields(root, {"schema", "levels"}, "custom-level manifest"); diff --git a/Engine/Game/World/custom_level_manifest.h b/Engine/Game/World/custom_level_manifest.h index 759a737..1ac866b 100644 --- a/Engine/Game/World/custom_level_manifest.h +++ b/Engine/Game/World/custom_level_manifest.h @@ -23,7 +23,7 @@ struct CustomLevelManifest { std::string issue; }; -// Parse the Studio-authored Patch/dingosdk-levels.json contract. Invalid input +// Parse a mod's or the Patch folder's reskate-levels.json. Invalid input // fails closed: no partial set of destinations is returned. CustomLevelManifest parse_custom_level_manifest(std::string_view text) noexcept; CustomLevelManifest read_custom_level_manifest(const std::filesystem::path& path) noexcept;