mirror of
https://github.com/JonasunderscoreJones/dayz-linux-gui-launcher.git
synced 2025-10-23 08:59:19 +02:00
feat: add subscription message for missing mods
This commit is contained in:
parent
7cd36d34fe
commit
897fbf1ab3
1 changed files with 10 additions and 1 deletions
11
dayz-mods.sh
11
dayz-mods.sh
|
@ -18,6 +18,8 @@ API_PARAMS=(
|
||||||
-H "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36"
|
-H "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
WORKSHOP_URL="https://steamcommunity.com/sharedfiles/filedetails/?id=@ID@"
|
||||||
|
|
||||||
DEBUG=0
|
DEBUG=0
|
||||||
LAUNCH=0
|
LAUNCH=0
|
||||||
SERVER=""
|
SERVER=""
|
||||||
|
@ -96,10 +98,16 @@ if [[ -n "${SERVER}" ]]; then
|
||||||
INPUT+=( $(jq -r ".mods[] | select(.app_id == ${DAYZ_ID}) | .id" <<< "${response}") )
|
INPUT+=( $(jq -r ".mods[] | select(.app_id == ${DAYZ_ID}) | .id" <<< "${response}") )
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
missing=0
|
||||||
mods=()
|
mods=()
|
||||||
for modid in "${INPUT[@]}"; do
|
for modid in "${INPUT[@]}"; do
|
||||||
modpath="${DIR_WORKSHOP}/${modid}"
|
modpath="${DIR_WORKSHOP}/${modid}"
|
||||||
[[ -d "${modpath}" ]] || err "Missing mod directory for: ${modid}"
|
if ! [[ -d "${modpath}" ]]; then
|
||||||
|
missing=1
|
||||||
|
msg "Missing mod directory for: ${modid}"
|
||||||
|
msg "Subscribe the mod here: $(sed -e "s/@ID@/${modid}/" <<< "${WORKSHOP_URL}")"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
modmeta="${modpath}/meta.cpp"
|
modmeta="${modpath}/meta.cpp"
|
||||||
[[ -f "${modmeta}" ]] || err "Missing mod metadata for: ${modid}"
|
[[ -f "${modmeta}" ]] || err "Missing mod metadata for: ${modid}"
|
||||||
|
@ -115,6 +123,7 @@ for modid in "${INPUT[@]}"; do
|
||||||
|
|
||||||
mods+=("@${modname}")
|
mods+=("@${modname}")
|
||||||
done
|
done
|
||||||
|
[[ "${missing}" == 1 ]] && exit 1
|
||||||
|
|
||||||
cmdline=()
|
cmdline=()
|
||||||
if [[ "${#mods[@]}" -gt 0 ]]; then
|
if [[ "${#mods[@]}" -gt 0 ]]; then
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue