mirror of
https://github.com/aclist/dztui.git
synced 2026-09-01 04:37:04 +02:00
Compare commits
No commits in common. "321384dc7bd44339568a3f63630e5fc13a644fc9" and "edee9b623435d02fa550b90e02d37c2d1fa76456" have entirely different histories.
321384dc7b
...
edee9b6234
27
CHANGELOG.md
27
CHANGELOG.md
@ -1,15 +1,6 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## [5.8.0] 2025-07-06
|
## [5.7.0] 2024-04-17
|
||||||
## Added
|
|
||||||
- Filter servers by official/unofficial status
|
|
||||||
- Automatically fetch geolocation records
|
|
||||||
## Changed
|
|
||||||
- Updated internal versioning of helper files
|
|
||||||
## Fixed
|
|
||||||
- Corrected erroneous 2024 date in prior changelog entries
|
|
||||||
|
|
||||||
## [5.7.0] 2025-04-17
|
|
||||||
## Added
|
## Added
|
||||||
- Save application dimensions when quitting and restore on subsequent boot
|
- Save application dimensions when quitting and restore on subsequent boot
|
||||||
## Fixed
|
## Fixed
|
||||||
@ -17,35 +8,35 @@
|
|||||||
## Changed
|
## Changed
|
||||||
- More direct server ping query method that should return marginally more accurate times
|
- More direct server ping query method that should return marginally more accurate times
|
||||||
|
|
||||||
## [5.6.7] 2025-04-04
|
## [5.6.7] 2024-04-04
|
||||||
## Dropped
|
## Dropped
|
||||||
- Removed extraneous pre-boot API checks that could cause error messages to be printed if the user had not set up an API key yet
|
- Removed extraneous pre-boot API checks that could cause error messages to be printed if the user had not set up an API key yet
|
||||||
|
|
||||||
## [5.6.6] 2025-03-16
|
## [5.6.6] 2024-03-16
|
||||||
## Changed
|
## Changed
|
||||||
- Update IP database records for 2025-03
|
- Update IP database records for 2025-03
|
||||||
|
|
||||||
## [5.6.5] 2025-03-04
|
## [5.6.5] 2024-03-04
|
||||||
## Fixed
|
## Fixed
|
||||||
- Livonia server results being dropped from batch queries
|
- Livonia server results being dropped from batch queries
|
||||||
|
|
||||||
## [5.6.4] 2025-02-10
|
## [5.6.4] 2024-02-10
|
||||||
### Changed
|
### Changed
|
||||||
- Drop launch flag and check for invocation through Steam automatically
|
- Drop launch flag and check for invocation through Steam automatically
|
||||||
|
|
||||||
## [5.6.3] 2025-02-09
|
## [5.6.3] 2024-02-09
|
||||||
### Changed
|
### Changed
|
||||||
- Update IP database records for 2025-02
|
- Update IP database records for 2025-02
|
||||||
|
|
||||||
## [5.6.2] 2025-01-22
|
## [5.6.2] 2024-01-22
|
||||||
### Fixed
|
### Fixed
|
||||||
- Resolve regression introduced with IP resolution feature in 5.6.0 (restores functionality of right-click action: Add to My Servers)
|
- Resolve regression introduced with IP resolution feature in 5.6.0 (restores functionality of right-click action: Add to My Servers)
|
||||||
|
|
||||||
## [5.6.1] 2025-01-10
|
## [5.6.1] 2024-01-10
|
||||||
### Fixed
|
### Fixed
|
||||||
- Add fallback support for jq 1.6
|
- Add fallback support for jq 1.6
|
||||||
|
|
||||||
## [5.6.0] 2025-01-06
|
## [5.6.0] 2024-01-06
|
||||||
### Added
|
### Added
|
||||||
- Application header bar and controls
|
- Application header bar and controls
|
||||||
- Menu context subtitle in header bar
|
- Menu context subtitle in header bar
|
||||||
|
|||||||
134
dzgui.sh
134
dzgui.sh
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
version=5.8.0
|
version=5.7.0
|
||||||
|
|
||||||
#CONSTANTS
|
#CONSTANTS
|
||||||
aid=221100
|
aid=221100
|
||||||
@ -49,9 +49,10 @@ freedesktop_path="$HOME/.local/share/applications"
|
|||||||
|
|
||||||
#HELPERS
|
#HELPERS
|
||||||
ui_helper="$helpers_path/ui.py"
|
ui_helper="$helpers_path/ui.py"
|
||||||
|
geo_file="$helpers_path/ips.csv"
|
||||||
km_helper="$helpers_path/latlon"
|
km_helper="$helpers_path/latlon"
|
||||||
|
sums_path="$helpers_path/sums.md5"
|
||||||
func_helper="$helpers_path/funcs"
|
func_helper="$helpers_path/funcs"
|
||||||
geo_helper="$helpers_path/ips.csv"
|
|
||||||
|
|
||||||
#REMOTE
|
#REMOTE
|
||||||
remote_host=gh
|
remote_host=gh
|
||||||
@ -62,6 +63,7 @@ stable_url="$url_prefix/dzgui"
|
|||||||
testing_url="$url_prefix/testing"
|
testing_url="$url_prefix/testing"
|
||||||
releases_url="https://github.com/$author/$repo/releases/download/browser"
|
releases_url="https://github.com/$author/$repo/releases/download/browser"
|
||||||
km_helper_url="$releases_url/latlon"
|
km_helper_url="$releases_url/latlon"
|
||||||
|
geo_file_url="$releases_url/ips.csv.gz"
|
||||||
|
|
||||||
|
|
||||||
set_im_module(){
|
set_im_module(){
|
||||||
@ -585,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"]="f128a97e744e9e11036d707198feb8a8"
|
["ui.py"]="a6fdbf3e3eb92b7bc78e6ae23882b10b"
|
||||||
["query_v2.py"]="55d339ba02512ac69de288eb3be41067"
|
["query_v2.py"]="55d339ba02512ac69de288eb3be41067"
|
||||||
["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397"
|
["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397"
|
||||||
["funcs"]="94287c75a5ae0a06a95dd439711e6fba"
|
["funcs"]="f6e8b113e586a4bb2ea40c9ee56ebc95"
|
||||||
["lan"]="c62e84ddd1457b71a85ad21da662b9af"
|
["lan"]="c62e84ddd1457b71a85ad21da662b9af"
|
||||||
)
|
)
|
||||||
local author="aclist"
|
local author="aclist"
|
||||||
@ -635,8 +637,18 @@ fetch_helpers_by_sum(){
|
|||||||
done
|
done
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
fetch_km_helper(){
|
fetch_geo_file(){
|
||||||
|
# for binary releases
|
||||||
|
local geo_sum="83bf7655a4197214b4be73dfa9a7b319"
|
||||||
local km_sum="b038fdb8f655798207bd28de3a004706"
|
local km_sum="b038fdb8f655798207bd28de3a004706"
|
||||||
|
local gzip="$helpers_path/ips.csv.gz"
|
||||||
|
if [[ ! -f $geo_file ]] || [[ $(get_hash $geo_file) != $geo_sum ]]; then
|
||||||
|
local res=$(get_response_code "$geo_file_url")
|
||||||
|
[[ $res -ne 200 ]] && raise_error_and_quit "Remote resource unavailable: '$geo_file_url'"
|
||||||
|
curl -Ls "$geo_file_url" > "$gzip"
|
||||||
|
#force overwrite
|
||||||
|
gunzip -f "$gzip"
|
||||||
|
fi
|
||||||
if [[ ! -f $km_helper ]] || [[ $(get_hash $km_helper) != $km_sum ]]; then
|
if [[ ! -f $km_helper ]] || [[ $(get_hash $km_helper) != $km_sum ]]; then
|
||||||
local res=$(get_response_code "$km_helper_url")
|
local res=$(get_response_code "$km_helper_url")
|
||||||
[[ $res -ne 200 ]] && raise_error_and_quit "Remote resource unavailable: '$km_helper_url'"
|
[[ $res -ne 200 ]] && raise_error_and_quit "Remote resource unavailable: '$km_helper_url'"
|
||||||
@ -644,119 +656,10 @@ fetch_km_helper(){
|
|||||||
chmod +x "$km_helper"
|
chmod +x "$km_helper"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
get_response_code(){
|
|
||||||
local url="$1"
|
|
||||||
curl -Ls -I -o /dev/null -w "%{http_code}" "$url"
|
|
||||||
}
|
|
||||||
raise_error_and_quit(){
|
|
||||||
echo "$1"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
fetch_ip_db(){
|
|
||||||
parse_dl_url(){
|
|
||||||
curl -Ls "$url" \
|
|
||||||
| grep "csv.gz" \
|
|
||||||
| awk -F"['']" '{print $2}'
|
|
||||||
}
|
|
||||||
|
|
||||||
parse_dl_url_date(){
|
|
||||||
local url="$1"
|
|
||||||
<<< "$url" \
|
|
||||||
awk -F/ '{print $5}' \
|
|
||||||
| awk -F"dbip-city-lite-" '{print $2}' \
|
|
||||||
| awk -F'.csv.gz' '{print $1}'
|
|
||||||
}
|
|
||||||
|
|
||||||
fetch(){
|
|
||||||
logger INFO "Triggering fetch routine"
|
|
||||||
local url="$1"
|
|
||||||
|
|
||||||
curl -Ls "$url" > "$base_file"
|
|
||||||
if [[ $? -ne 0 ]]; then
|
|
||||||
logger WARN "Abnormal exit while accessing '$url'"
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
gunzip -f "$base_file"
|
|
||||||
if [[ $? -ne 0 ]]; then
|
|
||||||
rm "$base_file"
|
|
||||||
logger WARN "Abnormal exit while unpacking gzip '$base_file'"
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
< "$extracted_file" grep -vE "^[a-z0-9]{4}:" | grep -v "::" > "$ip_file"
|
|
||||||
if [[ $? -ne 0 ]]; then
|
|
||||||
logger WARN "Abnormal exit while parsing IPs"
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
rm "${state_path}/${month}.csv"
|
|
||||||
|
|
||||||
readarray -t records < <(cat $ip_file | awk -F, 'NR==1 {print $1} END {print $1}')
|
|
||||||
if [[ ${records[0]} != "0.0.0.0" ]] && [[ ${records[1]} != "224.0.0.0" ]]; then
|
|
||||||
logger WARN "Anchor records missing in '$ip_file', possibly malformed"
|
|
||||||
rm "$ip_file"
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
mv "$ip_file" "$geo_helper"
|
|
||||||
if [[ $? -ne 0 ]]; then
|
|
||||||
logger WARN "Abnormal exit while moving '$ip_file' to '$helpers_path'"
|
|
||||||
rm "$ip_file"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "$month" > "$month_file"
|
|
||||||
logger INFO "Wrote '$month' to stub '$month_file'"
|
|
||||||
logger INFO "Updated '$ip_file'"
|
|
||||||
}
|
|
||||||
|
|
||||||
local url="https://db-ip.com/db/download/ip-to-city-lite"
|
|
||||||
local month_file="${state_path}/.month"
|
|
||||||
local ip_file="${state_path}/ips.csv"
|
|
||||||
|
|
||||||
# test main url
|
|
||||||
local res=$(get_response_code "$url")
|
|
||||||
if [[ $res -ne 200 ]]; then
|
|
||||||
logger WARN "Failed to retrieve remote resource: '$url' ($res)"
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
logger INFO "Resolved remote URL: '$url'"
|
|
||||||
|
|
||||||
# test dl url
|
|
||||||
local dl_url="$(parse_dl_url)"
|
|
||||||
local res=$(get_response_code "$dl_url")
|
|
||||||
if [[ $res -ne 200 ]]; then
|
|
||||||
logger WARN "Remote resource unavailable: '$dl_url' ($res)"
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
logger INFO "Resolved download URL: '$dl_url'"
|
|
||||||
|
|
||||||
local month=$(parse_dl_url_date "$dl_url")
|
|
||||||
local base_file="${state_path}/${month}.csv.gz"
|
|
||||||
local extracted_file="${state_path}/${month}.csv"
|
|
||||||
|
|
||||||
# no stub file
|
|
||||||
if [[ ! -f $month_file ]]; then
|
|
||||||
logger WARN "No stub file '$month_file' present"
|
|
||||||
fetch "$dl_url"
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
# local needs update
|
|
||||||
local last_month=$(< "$month_file")
|
|
||||||
if [[ $last_month != "$month" ]]; then
|
|
||||||
logger WARN "Local stub '$last_month' does not match remote stub '$month'"
|
|
||||||
fetch "$dl_url"
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
# if stub is same date, abort
|
|
||||||
logger INFO "Local stub '$last_month' is identical to remote, skipping"
|
|
||||||
}
|
|
||||||
fetch_helpers(){
|
fetch_helpers(){
|
||||||
fetch_a2s
|
fetch_a2s
|
||||||
fetch_dzq
|
fetch_dzq
|
||||||
fetch_km_helper
|
fetch_geo_file
|
||||||
fetch_ip_db
|
|
||||||
fetch_helpers_by_sum
|
fetch_helpers_by_sum
|
||||||
[[ ! -f $share_path/icon.png ]] && freedesktop_dirs
|
[[ ! -f $share_path/icon.png ]] && freedesktop_dirs
|
||||||
fetch_icons
|
fetch_icons
|
||||||
@ -996,6 +899,7 @@ test_connection(){
|
|||||||
stable_url="$url_prefix/dzgui"
|
stable_url="$url_prefix/dzgui"
|
||||||
testing_url="$url_prefix/testing"
|
testing_url="$url_prefix/testing"
|
||||||
km_helper_url="$releases_url/latlon"
|
km_helper_url="$releases_url/latlon"
|
||||||
|
geo_file_url="$releases_url/ips.csv.gz"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
legacy_cols(){
|
legacy_cols(){
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
version="5.8.0"
|
version=5.6.0
|
||||||
|
|
||||||
#CONSTANTS
|
#CONSTANTS
|
||||||
aid=221100
|
aid=221100
|
||||||
@ -605,20 +605,6 @@ filter_servers(){
|
|||||||
<<< "$filtered" awk -F$separator '!seen[$1]++'
|
<<< "$filtered" awk -F$separator '!seen[$1]++'
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
filter_official(){
|
|
||||||
if [[ ${filters[*]} =~ Official ]]; then
|
|
||||||
echo -n "$filtered"
|
|
||||||
else
|
|
||||||
<<< "$filtered" awk -F$separator '$10 == "Community"'
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
filter_community(){
|
|
||||||
if [[ ${filters[*]} =~ Unoffic ]]; then
|
|
||||||
echo -n "$filtered"
|
|
||||||
else
|
|
||||||
<<< "$filtered" awk -F$separator '$10 == "Official"'
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
filtered=$(filter_perspective)
|
filtered=$(filter_perspective)
|
||||||
filtered=$(filter_full)
|
filtered=$(filter_full)
|
||||||
@ -629,8 +615,6 @@ filter_servers(){
|
|||||||
filtered=$(filter_ascii)
|
filtered=$(filter_ascii)
|
||||||
filtered=$(filter_duplicates)
|
filtered=$(filter_duplicates)
|
||||||
filtered=$(filter_keyword)
|
filtered=$(filter_keyword)
|
||||||
filtered=$(filter_official)
|
|
||||||
filtered=$(filter_community)
|
|
||||||
|
|
||||||
if [[ -z "$filtered" ]]; then
|
if [[ -z "$filtered" ]]; then
|
||||||
logger WARN "Filter result is empty"
|
logger WARN "Filter result is empty"
|
||||||
@ -668,8 +652,7 @@ parse_server_json(){
|
|||||||
"\(.max_players)␞" +
|
"\(.max_players)␞" +
|
||||||
"\(if .gametype == null then "0" elif .gametype|split("lqs")[1] == null then "0" else .gametype|split("lqs")[1]|split(",")[0] end)␞" +
|
"\(if .gametype == null then "0" elif .gametype|split("lqs")[1] == null then "0" else .gametype|split("lqs")[1]|split(",")[0] end)␞" +
|
||||||
"\(.addr|split(":")[0]):\(if .gameport == null then "XXXX" else .gameport end)␞" +
|
"\(.addr|split(":")[0]):\(if .gameport == null then "XXXX" else .gameport end)␞" +
|
||||||
"\(.addr|split(":")[1])␞" +
|
"\(.addr|split(":")[1])"
|
||||||
"\(if .gametype == null then "null" else (.gametype|split(",")|if any(. == "external") then "Community" else "Official" end) end)"
|
|
||||||
' | sort -k1
|
' | sort -k1
|
||||||
}
|
}
|
||||||
align_versions_file(){
|
align_versions_file(){
|
||||||
|
|||||||
@ -17,6 +17,7 @@ import gi
|
|||||||
gi.require_version("Gtk", "3.0")
|
gi.require_version("Gtk", "3.0")
|
||||||
from gi.repository import Gtk, GLib, Gdk, GObject, Pango
|
from gi.repository import Gtk, GLib, Gdk, GObject, Pango
|
||||||
|
|
||||||
|
# 5.7.0
|
||||||
app_name = "DZGUI"
|
app_name = "DZGUI"
|
||||||
|
|
||||||
cache = {}
|
cache = {}
|
||||||
@ -37,7 +38,7 @@ mod_store = Gtk.ListStore(str, str, str, float, str)
|
|||||||
#cf. log_cols
|
#cf. log_cols
|
||||||
log_store = Gtk.ListStore(str, str, str, str)
|
log_store = Gtk.ListStore(str, str, str, str)
|
||||||
#cf. browser_cols
|
#cf. browser_cols
|
||||||
server_store = Gtk.ListStore(str, str, str, str, int, int, int, str, int, str)
|
server_store = Gtk.ListStore(str, str, str, str, int, int, int, str, int)
|
||||||
|
|
||||||
default_tooltip = "Select a row to see its detailed description"
|
default_tooltip = "Select a row to see its detailed description"
|
||||||
server_tooltip = [None, None]
|
server_tooltip = [None, None]
|
||||||
@ -95,9 +96,7 @@ filters = {
|
|||||||
"Full": False,
|
"Full": False,
|
||||||
"Low pop": True,
|
"Low pop": True,
|
||||||
"Non-ASCII": False,
|
"Non-ASCII": False,
|
||||||
"Duplicate": False,
|
"Duplicate": False
|
||||||
"Official": True,
|
|
||||||
"Unoffic.": True,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -554,7 +553,7 @@ def parse_server_rows(data):
|
|||||||
lines = data.stdout.splitlines()
|
lines = data.stdout.splitlines()
|
||||||
reader = csv.reader(lines, delimiter=delimiter)
|
reader = csv.reader(lines, delimiter=delimiter)
|
||||||
try:
|
try:
|
||||||
rows = [[row[0], row[1], row[2], row[3], int(row[4]), int(row[5]), int(row[6]), row[7], int(row[8]), row[9]] for row in reader if row]
|
rows = [[row[0], row[1], row[2], row[3], int(row[4]), int(row[5]), int(row[6]), row[7], int(row[8])] for row in reader if row]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
return 1
|
return 1
|
||||||
for row in rows:
|
for row in rows:
|
||||||
@ -1610,7 +1609,6 @@ class TreeView(Gtk.TreeView):
|
|||||||
if (column_title == "Map"):
|
if (column_title == "Map"):
|
||||||
column.set_fixed_width(300)
|
column.set_fixed_width(300)
|
||||||
|
|
||||||
if i != 10:
|
|
||||||
self.append_column(column)
|
self.append_column(column)
|
||||||
|
|
||||||
self.update_first_col(mode.dict["label"])
|
self.update_first_col(mode.dict["label"])
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user