1
0
Fork 0
mirror of https://github.com/aclist/dztui.git synced 2024-12-29 13:52:03 +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 - Standardize dialogs
- Query and connect by IP/port - 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 ## [2.6.0-rc.3] 2022-09-03
### Changed ### Changed
- Revert to legacy API method - Revert to legacy API method

View file

@ -401,9 +401,11 @@ connect(){
fi fi
ip=$(echo "$1" | awk -F"$separator" '{print $1}') ip=$(echo "$1" | awk -F"$separator" '{print $1}')
bid=$(echo "$1" | awk -F"$separator" '{print $2}') bid=$(echo "$1" | awk -F"$separator" '{print $2}')
#TODO: deprecated (for now) if [[ $2 == "ip" ]]; then
#fetch_mods_sa "$ip" fetch_mods_sa "$ip"
fetch_mods "$bid" else
fetch_mods "$bid"
fi
validate_mods validate_mods
rc=$? rc=$?
[[ $rc -eq 1 ]] && return [[ $rc -eq 1 ]] && return
@ -464,12 +466,12 @@ ip_table(){
echo "No selection" echo "No selection"
else else
local gameport="$(echo "$sel" | awk -F: '{print $2}')" 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 addr=$(< $json jq -r --arg gameport $gameport '.servers[]|select(.gameport == ($gameport|tonumber)).addr')
local qport=$(echo "$addr" | awk -F: '{print $2}') local qport=$(echo "$addr" | awk -F: '{print $2}')
local sa_ip=$(echo "$ip:$gameport%%$qport") local sa_ip=$(echo "$ip:$gameport%%$qport")
qport_list="$sa_ip" qport_list="$sa_ip"
connect "$sel" connect "$sel" "ip"
fi fi
done done
} }