1
0
Fork 0
mirror of https://github.com/aclist/dztui.git synced 2024-12-28 05:12:36 +01:00

Use alternate API for conn-by-ip

This commit is contained in:
aclist 2022-09-04 04:40:21 +09:00
parent 2e6bcd4d15
commit 319ab2da9e
2 changed files with 11 additions and 5 deletions

View file

@ -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

View file

@ -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
}