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

Merge pull request #195 from aclist/release/5.6.2
All checks were successful
Mirror to Codeberg / mirror-to-codeberg (push) Successful in 10s

chore: prepare release
This commit is contained in:
aclist 2025-01-24 16:40:07 +09:00 committed by GitHub
commit 0562d8230d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 49 additions and 3 deletions

View file

@ -1,5 +1,13 @@
# Changelog # Changelog
## [5.6.2] 2024-01-22
### Fixed
- Resolve regression introduced with IP resolution feature in 5.6.0 (restores functionality of right-click action: Add to My Servers)
## [5.6.1] 2024-01-10
### Fixed
- Add fallback support for jq 1.6
## [5.6.0] 2024-01-06 ## [5.6.0] 2024-01-06
### Added ### Added
- Application header bar and controls - Application header bar and controls

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -o pipefail set -o pipefail
version=5.6.1 version=5.6.2
#CONSTANTS #CONSTANTS
aid=221100 aid=221100
@ -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)