From 7d68f086aa15dd12c1b7b28c9c3d645a0b0a9565 Mon Sep 17 00:00:00 2001 From: Ziktofel Date: Tue, 18 Jun 2024 21:56:55 +0200 Subject: [PATCH] Add xml schema validation. Some minor script fixes SC2 itself ignores that declaration, Editor removes it Use the script to re-attach them --- .../Base.SC2Data/GameData/RequirementData.xml | 2 +- .../Base.SC2Data/GameData/UpgradeData.xml | 2 +- .../Base.SC2Data/GameData/RequirementData.xml | 2 +- .../Base.SC2Data/GameData/RequirementNodeData.xml | 2 +- .../Base.SC2Data/GameData/UpgradeData.xml | 2 +- .../Base.SC2Data/GameData/RequirementData.xml | 2 +- .../Base.SC2Data/GameData/RequirementNodeData.xml | 2 +- .../Base.SC2Data/GameData/UpgradeData.xml | 2 +- .../Base.SC2Data/GameData/RequirementData.xml | 2 +- .../Base.SC2Data/GameData/RequirementNodeData.xml | 2 +- .../Base.SC2Data/GameData/RequirementData.xml | 2 +- .../Base.SC2Data/GameData/RequirementNodeData.xml | 2 +- .../Base.SC2Data/GameData/UpgradeData.xml | 2 +- .../Base.SC2Data/GameData/RequirementNodeData.xml | 2 +- .../Base.SC2Data/GameData/UpgradeData.xml | 2 +- .../Base.SC2Data/GameData/RequirementData.xml | 2 +- .../Base.SC2Data/GameData/RequirementNodeData.xml | 2 +- .../Base.SC2Data/GameData/RequirementData.xml | 2 +- .../Base.SC2Data/GameData/RequirementNodeData.xml | 2 +- Maps/ArchipelagoCampaign/build.sh | 4 ++-- .../Base.SC2Data/GameData/UpgradeData.xml | 2 +- .../Base.SC2Data/GameData/RequirementData.xml | 2 +- .../Base.SC2Data/GameData/RequirementNodeData.xml | 2 +- .../Base.SC2Data/GameData/UpgradeData.xml | 2 +- .../Base.SC2Data/GameData/UpgradeData.xml | 2 +- .../Base.SC2Data/GameData/UpgradeData.xml | 2 +- .../Base.SC2Data/GameData/UpgradeData.xml | 2 +- .../Base.SC2Data/GameData/UpgradeData.xml | 2 +- scripts/setup_xml_schema_validation.sh | 8 ++++++++ 29 files changed, 37 insertions(+), 29 deletions(-) create mode 100755 scripts/setup_xml_schema_validation.sh diff --git a/Maps/ArchipelagoCampaign/HotS/ap_conviction.SC2Map/Base.SC2Data/GameData/RequirementData.xml b/Maps/ArchipelagoCampaign/HotS/ap_conviction.SC2Map/Base.SC2Data/GameData/RequirementData.xml index daf28d5f4..db0bcb328 100644 --- a/Maps/ArchipelagoCampaign/HotS/ap_conviction.SC2Map/Base.SC2Data/GameData/RequirementData.xml +++ b/Maps/ArchipelagoCampaign/HotS/ap_conviction.SC2Map/Base.SC2Data/GameData/RequirementData.xml @@ -1,5 +1,5 @@ - + diff --git a/Maps/ArchipelagoCampaign/HotS/ap_conviction.SC2Map/Base.SC2Data/GameData/UpgradeData.xml b/Maps/ArchipelagoCampaign/HotS/ap_conviction.SC2Map/Base.SC2Data/GameData/UpgradeData.xml index fc7386701..4d4a7cd93 100644 --- a/Maps/ArchipelagoCampaign/HotS/ap_conviction.SC2Map/Base.SC2Data/GameData/UpgradeData.xml +++ b/Maps/ArchipelagoCampaign/HotS/ap_conviction.SC2Map/Base.SC2Data/GameData/UpgradeData.xml @@ -1,5 +1,5 @@ - + diff --git a/Maps/ArchipelagoCampaign/HotS/ap_enemy_within.SC2Map/Base.SC2Data/GameData/RequirementData.xml b/Maps/ArchipelagoCampaign/HotS/ap_enemy_within.SC2Map/Base.SC2Data/GameData/RequirementData.xml index 1deb688a2..f837340df 100644 --- a/Maps/ArchipelagoCampaign/HotS/ap_enemy_within.SC2Map/Base.SC2Data/GameData/RequirementData.xml +++ b/Maps/ArchipelagoCampaign/HotS/ap_enemy_within.SC2Map/Base.SC2Data/GameData/RequirementData.xml @@ -1,5 +1,5 @@ - + diff --git a/Maps/ArchipelagoCampaign/HotS/ap_enemy_within.SC2Map/Base.SC2Data/GameData/RequirementNodeData.xml b/Maps/ArchipelagoCampaign/HotS/ap_enemy_within.SC2Map/Base.SC2Data/GameData/RequirementNodeData.xml index 60c2f1b4a..b8a04bf3f 100644 --- a/Maps/ArchipelagoCampaign/HotS/ap_enemy_within.SC2Map/Base.SC2Data/GameData/RequirementNodeData.xml +++ b/Maps/ArchipelagoCampaign/HotS/ap_enemy_within.SC2Map/Base.SC2Data/GameData/RequirementNodeData.xml @@ -1,5 +1,5 @@ - + diff --git a/Maps/ArchipelagoCampaign/HotS/ap_enemy_within.SC2Map/Base.SC2Data/GameData/UpgradeData.xml b/Maps/ArchipelagoCampaign/HotS/ap_enemy_within.SC2Map/Base.SC2Data/GameData/UpgradeData.xml index d933b4120..8dd3a0701 100644 --- a/Maps/ArchipelagoCampaign/HotS/ap_enemy_within.SC2Map/Base.SC2Data/GameData/UpgradeData.xml +++ b/Maps/ArchipelagoCampaign/HotS/ap_enemy_within.SC2Map/Base.SC2Data/GameData/UpgradeData.xml @@ -1,5 +1,5 @@ - + diff --git a/Maps/ArchipelagoCampaign/HotS/ap_fire_in_the_sky.SC2Map/Base.SC2Data/GameData/RequirementData.xml b/Maps/ArchipelagoCampaign/HotS/ap_fire_in_the_sky.SC2Map/Base.SC2Data/GameData/RequirementData.xml index a6b363d00..8389c0d0f 100644 --- a/Maps/ArchipelagoCampaign/HotS/ap_fire_in_the_sky.SC2Map/Base.SC2Data/GameData/RequirementData.xml +++ b/Maps/ArchipelagoCampaign/HotS/ap_fire_in_the_sky.SC2Map/Base.SC2Data/GameData/RequirementData.xml @@ -1,5 +1,5 @@ - + diff --git a/Maps/ArchipelagoCampaign/HotS/ap_fire_in_the_sky.SC2Map/Base.SC2Data/GameData/RequirementNodeData.xml b/Maps/ArchipelagoCampaign/HotS/ap_fire_in_the_sky.SC2Map/Base.SC2Data/GameData/RequirementNodeData.xml index 436d98c3b..97ad92b64 100644 --- a/Maps/ArchipelagoCampaign/HotS/ap_fire_in_the_sky.SC2Map/Base.SC2Data/GameData/RequirementNodeData.xml +++ b/Maps/ArchipelagoCampaign/HotS/ap_fire_in_the_sky.SC2Map/Base.SC2Data/GameData/RequirementNodeData.xml @@ -1,5 +1,5 @@ - + diff --git a/Maps/ArchipelagoCampaign/HotS/ap_fire_in_the_sky.SC2Map/Base.SC2Data/GameData/UpgradeData.xml b/Maps/ArchipelagoCampaign/HotS/ap_fire_in_the_sky.SC2Map/Base.SC2Data/GameData/UpgradeData.xml index 24b58deef..6a14fdfe2 100644 --- a/Maps/ArchipelagoCampaign/HotS/ap_fire_in_the_sky.SC2Map/Base.SC2Data/GameData/UpgradeData.xml +++ b/Maps/ArchipelagoCampaign/HotS/ap_fire_in_the_sky.SC2Map/Base.SC2Data/GameData/UpgradeData.xml @@ -1,5 +1,5 @@ - + diff --git a/Maps/ArchipelagoCampaign/HotS/ap_supreme.SC2Map/Base.SC2Data/GameData/RequirementData.xml b/Maps/ArchipelagoCampaign/HotS/ap_supreme.SC2Map/Base.SC2Data/GameData/RequirementData.xml index c3b483c18..a279aea1f 100644 --- a/Maps/ArchipelagoCampaign/HotS/ap_supreme.SC2Map/Base.SC2Data/GameData/RequirementData.xml +++ b/Maps/ArchipelagoCampaign/HotS/ap_supreme.SC2Map/Base.SC2Data/GameData/RequirementData.xml @@ -1,5 +1,5 @@ - + diff --git a/Maps/ArchipelagoCampaign/HotS/ap_supreme.SC2Map/Base.SC2Data/GameData/RequirementNodeData.xml b/Maps/ArchipelagoCampaign/HotS/ap_supreme.SC2Map/Base.SC2Data/GameData/RequirementNodeData.xml index 7b5fff3d7..69d03b230 100644 --- a/Maps/ArchipelagoCampaign/HotS/ap_supreme.SC2Map/Base.SC2Data/GameData/RequirementNodeData.xml +++ b/Maps/ArchipelagoCampaign/HotS/ap_supreme.SC2Map/Base.SC2Data/GameData/RequirementNodeData.xml @@ -1,5 +1,5 @@ - + diff --git a/Maps/ArchipelagoCampaign/HotS/ap_with_friends_like_these.SC2Map/Base.SC2Data/GameData/RequirementData.xml b/Maps/ArchipelagoCampaign/HotS/ap_with_friends_like_these.SC2Map/Base.SC2Data/GameData/RequirementData.xml index 3072966e5..a71e10d86 100644 --- a/Maps/ArchipelagoCampaign/HotS/ap_with_friends_like_these.SC2Map/Base.SC2Data/GameData/RequirementData.xml +++ b/Maps/ArchipelagoCampaign/HotS/ap_with_friends_like_these.SC2Map/Base.SC2Data/GameData/RequirementData.xml @@ -1,5 +1,5 @@ - + diff --git a/Maps/ArchipelagoCampaign/HotS/ap_with_friends_like_these.SC2Map/Base.SC2Data/GameData/RequirementNodeData.xml b/Maps/ArchipelagoCampaign/HotS/ap_with_friends_like_these.SC2Map/Base.SC2Data/GameData/RequirementNodeData.xml index 3478277d3..8eb2a8667 100644 --- a/Maps/ArchipelagoCampaign/HotS/ap_with_friends_like_these.SC2Map/Base.SC2Data/GameData/RequirementNodeData.xml +++ b/Maps/ArchipelagoCampaign/HotS/ap_with_friends_like_these.SC2Map/Base.SC2Data/GameData/RequirementNodeData.xml @@ -1,5 +1,5 @@ - + diff --git a/Maps/ArchipelagoCampaign/HotS/ap_with_friends_like_these.SC2Map/Base.SC2Data/GameData/UpgradeData.xml b/Maps/ArchipelagoCampaign/HotS/ap_with_friends_like_these.SC2Map/Base.SC2Data/GameData/UpgradeData.xml index 106072c71..2ee25b850 100644 --- a/Maps/ArchipelagoCampaign/HotS/ap_with_friends_like_these.SC2Map/Base.SC2Data/GameData/UpgradeData.xml +++ b/Maps/ArchipelagoCampaign/HotS/ap_with_friends_like_these.SC2Map/Base.SC2Data/GameData/UpgradeData.xml @@ -1,5 +1,5 @@ - + diff --git a/Maps/ArchipelagoCampaign/LotV/ap_last_stand.SC2Map/Base.SC2Data/GameData/RequirementNodeData.xml b/Maps/ArchipelagoCampaign/LotV/ap_last_stand.SC2Map/Base.SC2Data/GameData/RequirementNodeData.xml index c64426f55..e38e35ee1 100644 --- a/Maps/ArchipelagoCampaign/LotV/ap_last_stand.SC2Map/Base.SC2Data/GameData/RequirementNodeData.xml +++ b/Maps/ArchipelagoCampaign/LotV/ap_last_stand.SC2Map/Base.SC2Data/GameData/RequirementNodeData.xml @@ -1,5 +1,5 @@ - + diff --git a/Maps/ArchipelagoCampaign/LotV/ap_the_essence_of_eternity.SC2Map/Base.SC2Data/GameData/UpgradeData.xml b/Maps/ArchipelagoCampaign/LotV/ap_the_essence_of_eternity.SC2Map/Base.SC2Data/GameData/UpgradeData.xml index 3ae0de27a..a28a8ff75 100644 --- a/Maps/ArchipelagoCampaign/LotV/ap_the_essence_of_eternity.SC2Map/Base.SC2Data/GameData/UpgradeData.xml +++ b/Maps/ArchipelagoCampaign/LotV/ap_the_essence_of_eternity.SC2Map/Base.SC2Data/GameData/UpgradeData.xml @@ -1,5 +1,5 @@ - + diff --git a/Maps/ArchipelagoCampaign/WoL/ap_a_sinister_turn.SC2Map/Base.SC2Data/GameData/RequirementData.xml b/Maps/ArchipelagoCampaign/WoL/ap_a_sinister_turn.SC2Map/Base.SC2Data/GameData/RequirementData.xml index 0a5b7e7cc..ad131fe10 100644 --- a/Maps/ArchipelagoCampaign/WoL/ap_a_sinister_turn.SC2Map/Base.SC2Data/GameData/RequirementData.xml +++ b/Maps/ArchipelagoCampaign/WoL/ap_a_sinister_turn.SC2Map/Base.SC2Data/GameData/RequirementData.xml @@ -1,5 +1,5 @@ - + diff --git a/Maps/ArchipelagoCampaign/WoL/ap_all_in.SC2Map/Base.SC2Data/GameData/RequirementNodeData.xml b/Maps/ArchipelagoCampaign/WoL/ap_all_in.SC2Map/Base.SC2Data/GameData/RequirementNodeData.xml index 581bbca83..20c9be28e 100644 --- a/Maps/ArchipelagoCampaign/WoL/ap_all_in.SC2Map/Base.SC2Data/GameData/RequirementNodeData.xml +++ b/Maps/ArchipelagoCampaign/WoL/ap_all_in.SC2Map/Base.SC2Data/GameData/RequirementNodeData.xml @@ -1,5 +1,5 @@ - + diff --git a/Maps/ArchipelagoCampaign/WoL/ap_in_utter_darkness.SC2Map/Base.SC2Data/GameData/RequirementData.xml b/Maps/ArchipelagoCampaign/WoL/ap_in_utter_darkness.SC2Map/Base.SC2Data/GameData/RequirementData.xml index a21f5608e..c434d862f 100644 --- a/Maps/ArchipelagoCampaign/WoL/ap_in_utter_darkness.SC2Map/Base.SC2Data/GameData/RequirementData.xml +++ b/Maps/ArchipelagoCampaign/WoL/ap_in_utter_darkness.SC2Map/Base.SC2Data/GameData/RequirementData.xml @@ -1,5 +1,5 @@ - + diff --git a/Maps/ArchipelagoCampaign/WoL/ap_in_utter_darkness.SC2Map/Base.SC2Data/GameData/RequirementNodeData.xml b/Maps/ArchipelagoCampaign/WoL/ap_in_utter_darkness.SC2Map/Base.SC2Data/GameData/RequirementNodeData.xml index 314b29567..f2b7ce3d9 100644 --- a/Maps/ArchipelagoCampaign/WoL/ap_in_utter_darkness.SC2Map/Base.SC2Data/GameData/RequirementNodeData.xml +++ b/Maps/ArchipelagoCampaign/WoL/ap_in_utter_darkness.SC2Map/Base.SC2Data/GameData/RequirementNodeData.xml @@ -1,5 +1,5 @@ - + diff --git a/Maps/ArchipelagoCampaign/build.sh b/Maps/ArchipelagoCampaign/build.sh index c5f71ce11..78fe6e111 100755 --- a/Maps/ArchipelagoCampaign/build.sh +++ b/Maps/ArchipelagoCampaign/build.sh @@ -5,10 +5,10 @@ process_map() { mpqfile="$campaign"_build/$(sed "s/^$campaign\///g" <<< "$map") smpq -c $mpqfile pushd $map - for file in $(find . -type f) ; do + while read -r -d "" file ; do file=$(cut -c 3- <<< "$file") smpq -a ../../$mpqfile $file - done + done < <(find . -type f -print0) popd } export -f process_map diff --git a/Mods/ArchipelagoCore.SC2Mod/Base.SC2Data/GameData/UpgradeData.xml b/Mods/ArchipelagoCore.SC2Mod/Base.SC2Data/GameData/UpgradeData.xml index 4e001d2ac..326896fef 100644 --- a/Mods/ArchipelagoCore.SC2Mod/Base.SC2Data/GameData/UpgradeData.xml +++ b/Mods/ArchipelagoCore.SC2Mod/Base.SC2Data/GameData/UpgradeData.xml @@ -1,5 +1,5 @@ - + diff --git a/Mods/ArchipelagoPlayer.SC2Mod/Base.SC2Data/GameData/RequirementData.xml b/Mods/ArchipelagoPlayer.SC2Mod/Base.SC2Data/GameData/RequirementData.xml index b36b97b0f..48181b0f6 100644 --- a/Mods/ArchipelagoPlayer.SC2Mod/Base.SC2Data/GameData/RequirementData.xml +++ b/Mods/ArchipelagoPlayer.SC2Mod/Base.SC2Data/GameData/RequirementData.xml @@ -1,5 +1,5 @@ - + diff --git a/Mods/ArchipelagoPlayer.SC2Mod/Base.SC2Data/GameData/RequirementNodeData.xml b/Mods/ArchipelagoPlayer.SC2Mod/Base.SC2Data/GameData/RequirementNodeData.xml index 749fedcc6..94a9f2490 100644 --- a/Mods/ArchipelagoPlayer.SC2Mod/Base.SC2Data/GameData/RequirementNodeData.xml +++ b/Mods/ArchipelagoPlayer.SC2Mod/Base.SC2Data/GameData/RequirementNodeData.xml @@ -1,5 +1,5 @@ - + diff --git a/Mods/ArchipelagoPlayer.SC2Mod/Base.SC2Data/GameData/UpgradeData.xml b/Mods/ArchipelagoPlayer.SC2Mod/Base.SC2Data/GameData/UpgradeData.xml index ae49a1a30..1ea65dcad 100644 --- a/Mods/ArchipelagoPlayer.SC2Mod/Base.SC2Data/GameData/UpgradeData.xml +++ b/Mods/ArchipelagoPlayer.SC2Mod/Base.SC2Data/GameData/UpgradeData.xml @@ -1,5 +1,5 @@ - + diff --git a/Mods/ArchipelagoPlayerHotS.SC2Mod/Base.SC2Data/GameData/UpgradeData.xml b/Mods/ArchipelagoPlayerHotS.SC2Mod/Base.SC2Data/GameData/UpgradeData.xml index af16190b7..1c1dba04c 100644 --- a/Mods/ArchipelagoPlayerHotS.SC2Mod/Base.SC2Data/GameData/UpgradeData.xml +++ b/Mods/ArchipelagoPlayerHotS.SC2Mod/Base.SC2Data/GameData/UpgradeData.xml @@ -1,5 +1,5 @@ - + diff --git a/Mods/ArchipelagoPlayerLotV.SC2Mod/Base.SC2Data/GameData/UpgradeData.xml b/Mods/ArchipelagoPlayerLotV.SC2Mod/Base.SC2Data/GameData/UpgradeData.xml index 950a2656d..e471aecd1 100644 --- a/Mods/ArchipelagoPlayerLotV.SC2Mod/Base.SC2Data/GameData/UpgradeData.xml +++ b/Mods/ArchipelagoPlayerLotV.SC2Mod/Base.SC2Data/GameData/UpgradeData.xml @@ -1,5 +1,5 @@ - + diff --git a/Mods/ArchipelagoPlayerLotVPrologue.SC2Mod/Base.SC2Data/GameData/UpgradeData.xml b/Mods/ArchipelagoPlayerLotVPrologue.SC2Mod/Base.SC2Data/GameData/UpgradeData.xml index 569422543..7da651f92 100644 --- a/Mods/ArchipelagoPlayerLotVPrologue.SC2Mod/Base.SC2Data/GameData/UpgradeData.xml +++ b/Mods/ArchipelagoPlayerLotVPrologue.SC2Mod/Base.SC2Data/GameData/UpgradeData.xml @@ -1,5 +1,5 @@ - + diff --git a/Mods/ArchipelagoPlayerWoL.SC2Mod/Base.SC2Data/GameData/UpgradeData.xml b/Mods/ArchipelagoPlayerWoL.SC2Mod/Base.SC2Data/GameData/UpgradeData.xml index 02efe5970..bf4077318 100644 --- a/Mods/ArchipelagoPlayerWoL.SC2Mod/Base.SC2Data/GameData/UpgradeData.xml +++ b/Mods/ArchipelagoPlayerWoL.SC2Mod/Base.SC2Data/GameData/UpgradeData.xml @@ -1,5 +1,5 @@ - + diff --git a/scripts/setup_xml_schema_validation.sh b/scripts/setup_xml_schema_validation.sh new file mode 100755 index 000000000..cc4324f2f --- /dev/null +++ b/scripts/setup_xml_schema_validation.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -e + +script_dir=$PWD +cd "$script_dir/.." +find . -name "UpgradeData.xml" -exec sed -Ei 's#^##g' {} \; +find . -name "RequirementData.xml" -exec sed -Ei 's#^##g' {} \; +find . -name "RequirementNodeData.xml" -exec sed -Ei 's#^##g' {} \;