mirror of
https://github.com/JonasunderscoreJones/dayz-linux-gui-launcher.git
synced 2025-10-23 00:09:19 +02:00
feat: add -connect launch arg when --server is set
This commit is contained in:
parent
175bfb7c23
commit
1a947d3d76
1 changed files with 5 additions and 2 deletions
|
@ -86,8 +86,8 @@ check_dir "${DIR_DAYZ}"
|
|||
check_dir "${DIR_WORKSHOP}"
|
||||
|
||||
if [[ -n "${SERVER}" ]]; then
|
||||
msg "Querying API for server: ${SERVER}:${PORT}"
|
||||
query="$(sed -e "s/@ADDRESS@/${SERVER}/" -e "s/@PORT@/${PORT}/" <<< "${API_URL}")"
|
||||
msg "Querying API for server: ${SERVER%:*}:${PORT}"
|
||||
query="$(sed -e "s/@ADDRESS@/${SERVER%:*}/" -e "s/@PORT@/${PORT}/" <<< "${API_URL}")"
|
||||
debug "Querying ${query}"
|
||||
response="$(curl "${API_PARAMS[@]}" "${query}")"
|
||||
INPUT+=( $(jq -r ".mods[] | select(.app_id == ${DAYZ_ID}) | .id" <<< "${response}") )
|
||||
|
@ -117,6 +117,9 @@ cmdline=()
|
|||
if [[ "${#mods[@]}" -gt 0 ]]; then
|
||||
cmdline+=("\"-mod=$(IFS=";"; echo "${mods[*]}")\"")
|
||||
fi
|
||||
if [[ "${LAUNCH}" == 1 ]] && [[ -n "${SERVER}" ]]; then
|
||||
cmdline+=("-connect=${SERVER}")
|
||||
fi
|
||||
|
||||
if [[ "${LAUNCH}" == 1 ]]; then
|
||||
set -x
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue