mirror of
https://github.com/JonasunderscoreJones/dayz-linux-gui-launcher.git
synced 2025-10-23 06:59:20 +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}"
|
check_dir "${DIR_WORKSHOP}"
|
||||||
|
|
||||||
if [[ -n "${SERVER}" ]]; then
|
if [[ -n "${SERVER}" ]]; then
|
||||||
msg "Querying API for server: ${SERVER}:${PORT}"
|
msg "Querying API for server: ${SERVER%:*}:${PORT}"
|
||||||
query="$(sed -e "s/@ADDRESS@/${SERVER}/" -e "s/@PORT@/${PORT}/" <<< "${API_URL}")"
|
query="$(sed -e "s/@ADDRESS@/${SERVER%:*}/" -e "s/@PORT@/${PORT}/" <<< "${API_URL}")"
|
||||||
debug "Querying ${query}"
|
debug "Querying ${query}"
|
||||||
response="$(curl "${API_PARAMS[@]}" "${query}")"
|
response="$(curl "${API_PARAMS[@]}" "${query}")"
|
||||||
INPUT+=( $(jq -r ".mods[] | select(.app_id == ${DAYZ_ID}) | .id" <<< "${response}") )
|
INPUT+=( $(jq -r ".mods[] | select(.app_id == ${DAYZ_ID}) | .id" <<< "${response}") )
|
||||||
|
@ -117,6 +117,9 @@ cmdline=()
|
||||||
if [[ "${#mods[@]}" -gt 0 ]]; then
|
if [[ "${#mods[@]}" -gt 0 ]]; then
|
||||||
cmdline+=("\"-mod=$(IFS=";"; echo "${mods[*]}")\"")
|
cmdline+=("\"-mod=$(IFS=";"; echo "${mods[*]}")\"")
|
||||||
fi
|
fi
|
||||||
|
if [[ "${LAUNCH}" == 1 ]] && [[ -n "${SERVER}" ]]; then
|
||||||
|
cmdline+=("-connect=${SERVER}")
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "${LAUNCH}" == 1 ]]; then
|
if [[ "${LAUNCH}" == 1 ]]; then
|
||||||
set -x
|
set -x
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue