From 319ab2da9e442dd02ee47855cd05ab623180a0d1 Mon Sep 17 00:00:00 2001 From: aclist Date: Sun, 4 Sep 2022 04:40:21 +0900 Subject: [PATCH] Use alternate API for conn-by-ip --- changelog.md | 4 ++++ dzgui.sh | 12 +++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/changelog.md b/changelog.md index 6174ae8..1b0cd44 100644 --- a/changelog.md +++ b/changelog.md @@ -6,6 +6,10 @@ - Standardize dialogs - Query and connect by IP/port +## [2.6.0-rc.4] 2022-09-03 +### Fixed +- Use alternate API for direct IP queries + ## [2.6.0-rc.3] 2022-09-03 ### Changed - Revert to legacy API method diff --git a/dzgui.sh b/dzgui.sh index 22c6d76..bdfc897 100755 --- a/dzgui.sh +++ b/dzgui.sh @@ -401,9 +401,11 @@ connect(){ fi ip=$(echo "$1" | awk -F"$separator" '{print $1}') bid=$(echo "$1" | awk -F"$separator" '{print $2}') - #TODO: deprecated (for now) - #fetch_mods_sa "$ip" - fetch_mods "$bid" + if [[ $2 == "ip" ]]; then + fetch_mods_sa "$ip" + else + fetch_mods "$bid" + fi validate_mods rc=$? [[ $rc -eq 1 ]] && return @@ -464,12 +466,12 @@ ip_table(){ echo "No selection" else local gameport="$(echo "$sel" | awk -F: '{print $2}')" - local ip="$(echo "$sel" | awk -F: '{print $1}')" + ip="$(echo "$sel" | awk -F: '{print $1}')" local addr=$(< $json jq -r --arg gameport $gameport '.servers[]|select(.gameport == ($gameport|tonumber)).addr') local qport=$(echo "$addr" | awk -F: '{print $2}') local sa_ip=$(echo "$ip:$gameport%%$qport") qport_list="$sa_ip" - connect "$sel" + connect "$sel" "ip" fi done }