From 1554520704bfa173fa4c10932991954814034f6c Mon Sep 17 00:00:00 2001 From: Daniel Ceregatti Date: Fri, 15 Dec 2023 22:13:20 -0800 Subject: [PATCH] Update Winter Chernarus (Deer Isle, Livonia) metadata from updated instructions. Add cfgGameplay.json hack. Fix JSON formatting. --- files/mods/1891132304/cfggameplay.json | 2 +- files/mods/1891132304/cfgweather.xml | 6 +++--- files/mods/1891132304/types.xml | 14 ++++++++++++++ files/mods/1891132304/xml.env | 3 ++- server/bin/dz | 23 +++++++++++++++++++++-- 5 files changed, 41 insertions(+), 7 deletions(-) create mode 100644 files/mods/1891132304/types.xml diff --git a/files/mods/1891132304/cfggameplay.json b/files/mods/1891132304/cfggameplay.json index aa8ae87..d56baed 100644 --- a/files/mods/1891132304/cfggameplay.json +++ b/files/mods/1891132304/cfggameplay.json @@ -1,6 +1,6 @@ { "WorldsData":{ "environmentMinTemps": [-7.0, -5.0, -3.0, -2.0, 0.0, 2.0, 5.0, 10.0, 7.0, 5.0, 1.0, -2.0], - "environmentMaxTemps": [-3.0, -1.0, 2.0, 5.0, 7.0, 10.0, 12.0, 16.0, 13.0, 10.0, 7.0, 2.0], + "environmentMaxTemps": [-3.0, -1.0, 2.0, 5.0, 7.0, 10.0, 12.0, 16.0, 13.0, 10.0, 7.0, 2.0] } } diff --git a/files/mods/1891132304/cfgweather.xml b/files/mods/1891132304/cfgweather.xml index 1860627..626ae17 100644 --- a/files/mods/1891132304/cfgweather.xml +++ b/files/mods/1891132304/cfgweather.xml @@ -1,5 +1,5 @@ - + @@ -14,7 +14,7 @@ - + @@ -24,4 +24,4 @@ - \ No newline at end of file + diff --git a/files/mods/1891132304/types.xml b/files/mods/1891132304/types.xml new file mode 100644 index 0000000..03f6d84 --- /dev/null +++ b/files/mods/1891132304/types.xml @@ -0,0 +1,14 @@ + + + + 0 + 1209600 + 0 + 0 + -1 + -1 + 100 + + + + diff --git a/files/mods/1891132304/xml.env b/files/mods/1891132304/xml.env index 6e90116..3974fba 100644 --- a/files/mods/1891132304/xml.env +++ b/files/mods/1891132304/xml.env @@ -1,3 +1,4 @@ +TYPES=local INIT=local CFGGAMEPLAY=local -CFGWEATHER=local \ No newline at end of file +CFGWEATHER=local diff --git a/server/bin/dz b/server/bin/dz index c29b6d3..c0f38e0 100755 --- a/server/bin/dz +++ b/server/bin/dz @@ -221,7 +221,9 @@ mergexml(){ echo "Merge JSON '${WORKSHOP_DIR}/${ID}/${var,,}.json' -> '${MPMISSIONS}/${MAP}/${var,,}.json'" rm -f /tmp/x /tmp/y jq -s '.[0] * .[1]' ${MPMISSIONS}/${MAP}/${var,,}.json ${WORKSHOP_DIR}/${ID}/${var,,}.json > /tmp/x - mv /tmp/x ${MPMISSIONS}/${MAP}/${var,,}.json +# mv /tmp/x ${MPMISSIONS}/${MAP}/${var,,}.json + # FIXME: This is a hack to fix the JSON file, as it expects mixed case + mv /tmp/x ${MPMISSIONS}/${MAP}/cfgGameplay.json fi done # These are merged directly into the upstream file, but are C @@ -243,6 +245,22 @@ mergexml(){ ) fi done + # These are copied verbatim + for var in "CFGWEATHER" + do + if [ -f "${WORKSHOP_DIR}/${ID}/${var,,}.xml" ] + then + if [[ ${FOUND} = 0 ]] + then + MODNAME=$(get_mod_name ${ID}) + echo + echo -e "${green}Adding mod integration ${MODNAME}${default}" + FOUND=1 + fi + echo "Copy -> '${WORKSHOP_DIR}/${ID}/${var,,}.xml' -> '${MPMISSIONS}/${MAP}/${var,,}.xml'" + cp ${WORKSHOP_DIR}/${ID}/${var,,}.xml ${MPMISSIONS}/${MAP}/${var,,}.xml + fi + done done if [ -d ${SERVER_PROFILE}/custom ] then @@ -292,7 +310,8 @@ mergexml(){ echo "Merge JSON '${SERVER_PROFILE}/custom/${dir}/${var,,}.json' -> '${MPMISSIONS}/${MAP}/${var,,}.json'" rm -f /tmp/x /tmp/y jq -s '.[0] * .[1]' ${MPMISSIONS}/${MAP}/${var,,}.json ${SERVER_PROFILE}/custom/${dir}/${var,,}.json > /tmp/x - mv /tmp/x ${MPMISSIONS}/${MAP}/${var,,}.json +# mv /tmp/x ${MPMISSIONS}/${MAP}/${var,,}.json + mv /tmp/x ${MPMISSIONS}/${MAP}/cfgGameplay.json fi done if [[ ${FOUND} = 1 ]]