From a752ab325cf46d35a90606a354775799977dccb0 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Thu, 4 Sep 2025 15:46:25 -0400 Subject: [Data] Strip unnecessary AP IDs This was causing issues in the client, specifically for The Ancient. --- tools/validator/validator.cpp | 79 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 77 insertions(+), 2 deletions(-) (limited to 'tools/validator/validator.cpp') diff --git a/tools/validator/validator.cpp b/tools/validator/validator.cpp index fd004d7..ab1612e 100644 --- a/tools/validator/validator.cpp +++ b/tools/validator/validator.cpp @@ -172,6 +172,10 @@ class Validator { door_info.progressives_referenced_by) { std::cout << " PROGRESSIVE " << prog_name << std::endl; } + + if (door_info.has_id) { + std::cout << " An AP ID is present." << std::endl; + } } else if (door_info.definitions.size() > 1) { std::cout << "Door " << door_identifier.ShortDebugString() << " was defined multiple times." << std::endl; @@ -215,6 +219,17 @@ class Validator { << " is a location that depends on double_letters." << std::endl; } + + bool needs_id = (h_door.type() != DoorType::EVENT); + if (door_info.has_id != needs_id) { + if (needs_id) { + std::cout << "Door " << door_identifier.ShortDebugString() + << " is missing an AP ID." << std::endl; + } else { + std::cout << "Door " << door_identifier.ShortDebugString() + << " should not have an AP ID." << std::endl; + } + } } } @@ -280,6 +295,10 @@ class Validator { std::cout << " CONNECTION " << connection.ShortDebugString() << std::endl; } + + if (panel_info.has_id) { + std::cout << " An AP ID is present." << std::endl; + } } else if (panel_info.definitions.size() > 1) { std::cout << "Panel " << panel_identifier.ShortDebugString() << " was defined multiple times." << std::endl; @@ -308,6 +327,11 @@ class Validator { << "\" was defined multiple times." << std::endl; } } + + if (!panel_info.has_id) { + std::cout << "Panel " << panel_identifier.ShortDebugString() + << " is missing an AP ID." << std::endl; + } } void ValidateKeyholder(const KeyholderIdentifier& keyholder_identifier, @@ -321,10 +345,28 @@ class Validator { std::cout << " DOOR " << door_identifier.ShortDebugString() << std::endl; } + + if (keyholder_info.has_id) { + std::cout << " An AP ID is present." << std::endl; + } } else if (keyholder_info.definitions.size() > 1) { std::cout << "Keyholder " << keyholder_identifier.ShortDebugString() << " was defined multiple times." << std::endl; } + + for (const HumanKeyholder& h_keyholder : keyholder_info.definitions) { + bool needs_id = (h_keyholder.has_key()); + + if (needs_id != keyholder_info.has_id) { + if (needs_id) { + std::cout << "Keyholder " << keyholder_identifier.ShortDebugString() + << " is missing an AP ID." << std::endl; + } else { + std::cout << "Keyholder " << keyholder_identifier.ShortDebugString() + << " should not have an AP ID." << std::endl; + } + } + } } void ValidateLetter(const LetterIdentifier& letter_identifier, @@ -332,7 +374,14 @@ class Validator { std::string letter_name = std::string(1, std::get<0>(letter_identifier)) + (std::get<1>(letter_identifier) ? "2" : "1"); - if (letter_info.defined_in.size() > 1) { + if (letter_info.defined_in.empty()) { + std::cout << "Letter " << letter_name + << " has no definition, but was referenced:" << std::endl; + + if (letter_info.has_id) { + std::cout << " An AP ID is present." << std::endl; + } + } else if (letter_info.defined_in.size() > 1) { std::cout << "Letter " << letter_name << " was defined in multiple places:" << std::endl; @@ -340,6 +389,11 @@ class Validator { std::cout << " " << room_identifier.ShortDebugString() << std::endl; } } + + if (!letter_info.has_id) { + std::cout << "Letter " << letter_name << " is missing an AP ID." + << std::endl; + } } void ValidateEnding(const std::string& ending_name, @@ -353,6 +407,10 @@ class Validator { std::cout << " DOOR " << door_identifier.ShortDebugString() << std::endl; } + + if (ending_info.has_id) { + std::cout << " An AP ID is present." << std::endl; + } } else if (ending_info.defined_in.size() > 1) { std::cout << "Ending " << ending_name << " was defined in multiple places:" << std::endl; @@ -361,6 +419,11 @@ class Validator { std::cout << " " << room_identifier.ShortDebugString() << std::endl; } } + + if (!ending_info.has_id) { + std::cout << "Ending " << ending_name << " is missing an AP ID." + << std::endl; + } } void ValidatePanelName(const std::string& panel_name, @@ -379,10 +442,22 @@ class Validator { void ValidateProgressive(const std::string& prog_name, const ProgressiveInfo& prog_info) const { - if (prog_info.definitions.size() > 1) { + if (prog_info.definitions.empty()) { + std::cout << "Progressive \"" << prog_name + << "\" has no definition, but was referenced:" << std::endl; + + if (prog_info.has_id) { + std::cout << " An AP ID is present." << std::endl; + } + } else if (prog_info.definitions.size() > 1) { std::cout << "Progressive \"" << prog_name << "\" has multiple definitions." << std::endl; } + + if (!prog_info.has_id) { + std::cout << "Progressive \"" << prog_name << "\" is missing an AP ID." + << std::endl; + } } const CollectedInfo& info_; -- cgit 1.4.1