1
0
Fork 0
mirror of https://github.com/aclist/dztui.git synced 2025-03-15 00:43:01 +01:00

Merge pull request #194 from aclist/release/5.7.0-beta.6
All checks were successful
Mirror to Codeberg / mirror-to-codeberg (push) Successful in 15s

fix: resolve regression introduced with 13c6813
This commit is contained in:
aclist 2025-01-11 06:43:51 +09:00 committed by GitHub
commit 25ec6ec08d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 51 additions and 4 deletions

View file

@ -1,11 +1,20 @@
# Changelog # Changelog
## [5.7.0-beta.6] 2024-01-10
## Fixed
- Resolve regression introduced with IP resolution feature in 13c6813
## [5.7.0-beta.5] 2024-01-10
## Changed
- Stricter redacting of usernames (again)
## [5.7.0-beta.4] 2024-01-10
## Fixed
- Clerical hotfix
## [5.7.0-beta.3] 2024-01-10 ## [5.7.0-beta.3] 2024-01-10
## Changed ## Changed
- Support legacy jq syntax for Ubuntu variants - Support legacy jq syntax for Ubuntu variants
## Fixed
- Stricter redacting of usernames (again)
## [5.7.0-beta.2] 2024-01-07 ## [5.7.0-beta.2] 2024-01-07
## Fixed ## Fixed

View file

@ -587,10 +587,10 @@ fetch_helpers_by_sum(){
[[ -f "$config_file" ]] && source "$config_file" [[ -f "$config_file" ]] && source "$config_file"
declare -A sums declare -A sums
sums=( sums=(
["ui.py"]="d3ad9153d8599bea0eede9fd3121ee8e" ["ui.py"]="5a876efacf208d12b5fe761996425412"
["query_v2.py"]="55d339ba02512ac69de288eb3be41067" ["query_v2.py"]="55d339ba02512ac69de288eb3be41067"
["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397" ["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397"
["funcs"]="6a1c7ce585d9b76e2e75dba9d4295f8d" ["funcs"]="417bd5eaffbefc905a843985c691dc64"
["lan"]="c62e84ddd1457b71a85ad21da662b9af" ["lan"]="c62e84ddd1457b71a85ad21da662b9af"
) )
local author="aclist" local author="aclist"

View file

@ -130,6 +130,7 @@ declare -A funcs=(
["Remove from my servers"]="update_favs_from_table" ["Remove from my servers"]="update_favs_from_table"
["Remove from history"]="remove_from_history" ["Remove from history"]="remove_from_history"
["Force update local mods"]="force_update" ["Force update local mods"]="force_update"
["Resolve IP"]="resolve_ip"
["Handshake"]="final_handshake" ["Handshake"]="final_handshake"
["get_player_count"]="get_player_count" ["get_player_count"]="get_player_count"
["lan_scan"]="lan_scan" ["lan_scan"]="lan_scan"
@ -161,6 +162,33 @@ find_stale_mods(){
printf "" printf ""
return 99 return 99
} }
resolve_ip(){
shift
local res
local record="$1"
local ip=$(<<< "$record" awk -F: '{print $1}')
local qport=$(<<< "$record" awk -F: '{print $3}')
res=$(a2s $ip $qport info)
if [[ ! $? -eq 0 ]]; then
printf "Server timed out \n"
return 1
fi
local gport=$(<<< "$res" jq -r '.[].gameport')
if [[ -z $gport ]]; then
printf "Failed to resolve server metadata\n"
return 1
fi
# incoming input can only be 'remove' or 'add'
# record is in favs => implies deletion
# record not in favs => implies addition
resolved_record="$ip:$gport:$qport"
if [[ ${ip_list[*]} =~ $resolved_record ]]; then
remove_from_favs "$resolved_record"
else
add_to_favs "$resolved_record"
fi
}
get_player_count(){ get_player_count(){
shift shift
local res local res

View file

@ -1814,10 +1814,16 @@ class TreeView(Gtk.TreeView):
def format_metadata(row_sel): def format_metadata(row_sel):
# this function is recycled for the add by ip/id methods +
# the right-click context menu (add/remove servers)
# in the latter case, there is no metadata to update
# see grid.update_statusbar(), so the returned row is None
row = None
for i in RowType: for i in RowType:
if i.dict["label"] == row_sel: if i.dict["label"] == row_sel:
row = i row = i
prefix = i.dict["tooltip"] prefix = i.dict["tooltip"]
break
vals = { vals = {
"branch": config_vals[0], "branch": config_vals[0],
"debug": config_vals[1], "debug": config_vals[1],
@ -1827,6 +1833,8 @@ def format_metadata(row_sel):
"preferred_client": config_vals[5], "preferred_client": config_vals[5],
"fullscreen": config_vals[6] "fullscreen": config_vals[6]
} }
if row is None:
return None
try: try:
alt = row.dict["alt"] alt = row.dict["alt"]
default = row.dict["default"] default = row.dict["default"]
@ -2396,6 +2404,8 @@ class Grid(Gtk.Grid):
return True return True
def update_statusbar(self, string): def update_statusbar(self, string):
if string is None:
return
meta = self.bar.get_context_id("Statusbar") meta = self.bar.get_context_id("Statusbar")
self.bar.push(meta, string) self.bar.push(meta, string)