Compare commits

..
1 Commits
Author SHA1 Message Date
aclist 12e91c4ba8 Merge 07cbf7a36a into 04e9e5dcf0 2026-08-26 07:57:29 +00:00
13 changed files with 30 additions and 97 deletions

No files matched your search

+4 -9
View File
@@ -346,15 +346,10 @@ def get_details(record: Record) -> Details:
try:
dlc = rules.dlc_flags
match dlc:
case 0:
dlc = strings.dlc_none
case 2:
dlc = strings.dlc_frostline
case 3:
dlc = strings.dlc_badlands
case _:
dlc = strings.unspecified
if dlc == 0:
dlc = strings.none
if dlc == 2:
dlc = strings.dlc_frostline
except AttributeError:
dlc = strings.unspecified
+9 -16
View File
@@ -151,9 +151,7 @@ def get_remote_signatures(mods: list[str]) -> list[tuple[str, str, int, int]]:
return hashes
def connect_debug(
client: str, addr: str, appid: int, name: str, mods: list[str]
) -> str:
def connect_debug(client: str, addr: str, appid: int, name: str, mods: list[str]) -> str:
concat = concat_mods(mods)
client_args = concat_bash_args(client)
params = [
@@ -169,7 +167,6 @@ def connect_debug(
client_args.extend(params)
return " ".join(client_args)
# TODO: set config to name=user, use official server and no mods,
# ensure that formatted string is identical to fixture with same hash
def connect(client: str, addr: str, appid: int, name: str, mods: list[str]) -> int:
@@ -238,18 +235,14 @@ def find_user_id(path: Path) -> str | None:
try:
with open(resolved_path, "r") as f:
v = vdf.load(f)
users = v["users"]
# NOTE: beta client: /package/beta
last_user = str(next(iter(users)))
if len(users) == 1:
return last_user
last_stamp = int(users[last_user]["Timestamp"])
for user in users:
stamp = int(users[user]["Timestamp"])
if stamp > last_stamp:
last_stamp = stamp
last_user = user
return last_user
# NOTE: beta client
# /package/beta
if len(v["users"]) == 1:
return str(list(v["users"].keys())[0])
for user in v["users"]:
if v["users"][user]["MostRecent"] == "1":
return str(user)
return None
except Exception as e:
logger.debug(e)
return None
-1
View File
@@ -523,7 +523,6 @@ class Controller(GObject.GObject):
def set_start_tab(self) -> None:
ind = self.config_man.get_start_tab()
logger.info(f"Setting start tab to index {ind}")
self.get_servers().notebook.set_current_page(ind)
def get_debug_args(self) -> str:
+1
View File
@@ -84,5 +84,6 @@ class CalcDist:
except Exception:
return None
# TODO: handle failed remote dist
haversine = Haversine(local.lat, local.lon, remote.lat, remote.lon)
return haversine
+9 -1
View File
@@ -2,13 +2,14 @@ import a2s
import requests
import shutil
import subprocess
from warnings import deprecated
from dataclasses import dataclass
from typing import TYPE_CHECKING
from dzgui.api.servers import Record
from dzgui.const.constants import REQUEST_TIMEOUT
from dzgui.const.endpoints import IP_ECHO
from dzgui.const.endpoints import COORDS_API, IP_ECHO
if TYPE_CHECKING:
@@ -126,3 +127,10 @@ def is_valid_port(port: str) -> bool:
if not port.isdigit() or int(port) == 0 or int(port[0]) == 0 or int(port) > 65535:
return True
return False
@deprecated("use ips.csv")
def get_local_coords(ip: str) -> str:
url = COORDS_API + "/" + ip
# local res=$(curl -Ls "$url" | jq -r '"\(.lat)\n\(.lon)"')
return url
+1 -2
View File
@@ -168,12 +168,11 @@ none_provided = "None provided"
disabled = "Disabled"
enabled = "Enabled"
null = "-"
none = "None"
unspecified = "not specified"
# DLC
dlc_frostline = "Frostline"
dlc_badlands = "Badlands"
dlc_none = "None"
# platform
windows = "Windows"
+4 -5
View File
@@ -496,7 +496,8 @@ class Assistant(Gtk.Assistant):
if page.is_migrated():
sp = page.migrated_conf["default_steam_path"]
self.page_shortcuts.set_steam_path(sp)
self.config_values = self.page_migration.migrated_conf
self.write_config(self.page_migration.migrated_conf)
self.setup_complete = True
return self.get_final_page()
case SteamPathPage():
self.config_values["default_steam_path"] = page.get_path_from_radio()
@@ -508,9 +509,11 @@ class Assistant(Gtk.Assistant):
self.config_values["name"] = name
self.config_values["use_miles"] = use_miles
self.config_values["client"] = client
self.write_config(self.config_values)
self.page_shortcuts.set_steam_path(
self.config_values["default_steam_path"]
)
self.setup_complete = True
case ShortcutCreationPage():
page.create_shortcuts()
case _:
@@ -562,10 +565,6 @@ class Assistant(Gtk.Assistant):
if not isinstance(page, IntroductionPage):
EMITTER.emit("step_pending")
if page == self.page_completion:
self.write_config(self.config_values)
self.setup_complete = True
class CheckboxWithLabel(Gtk.Box):
def __init__(self, text: str, blurb_text: str) -> None:
+1 -1
View File
@@ -4,7 +4,7 @@ description = "DayZ server browser and mod manager for Linux"
authors = [
{name = "aclist"}
]
version = "7.0.0b23"
version = "7.0.0b22"
license = "GPL-3.0-or-later"
license-files = ["LICENSE"]
readme = "README.md"
-23
View File
@@ -1,23 +0,0 @@
"users"
{
"0"
{
"AccountName" "STEAMUSER"
"PersonaName" "STEAMUSER"
"RememberPassword" "0"
"WantsOfflineMode" "0"
"SkipOfflineModeWarning" "0"
"AutoLogin" "1"
"Timestamp" "1787904411"
}
"1"
{
"AccountName" "STEAMUSER2"
"PersonaName" "STEAMUSER2"
"RememberPassword" "0"
"WantsOfflineMode" "0"
"SkipOfflineModeWarning" "0"
"AutoLogin" "1"
"Timestamp" "1787904647"
}
}
@@ -1,23 +0,0 @@
"users"
{
"0"
{
"AccountName" "STEAMUSER"
"PersonaName" "STEAMUSER"
"RememberPassword" "0"
"WantsOfflineMode" "0"
"SkipOfflineModeWarning" "0"
"AutoLogin" "1"
"Timestamp" "1797904411"
}
"1"
{
"AccountName" "STEAMUSER2"
"PersonaName" "STEAMUSER2"
"RememberPassword" "0"
"WantsOfflineMode" "0"
"SkipOfflineModeWarning" "0"
"AutoLogin" "1"
"Timestamp" "1787904647"
}
}
+1 -1
View File
@@ -20,6 +20,6 @@
"SkipOfflineModeWarning" "0"
"AllowAutoLogin" "1"
"MostRecent" "1"
"Timestamp" "10"
"Timestamp" "0"
}
}
-2
View File
@@ -14,8 +14,6 @@ pytestmark = pytest.mark.apitest
("api/loginusers_legacy_client.vdf", 0),
("api/loginusers_legacy_client_multiple.vdf", 1),
("api/loginusers_beta_client.vdf", 0),
("api/loginusers_beta_client_multiple.vdf", 1),
("api/loginusers_beta_client_multiple_2.vdf", 0),
],
)
def test_loginusers(monkeypatch, fixture: str, expect: int) -> None:
-13
View File
@@ -1,13 +0,0 @@
from pathlib import Path
from dzgui.config.xdg import get_xdg_paths
def test_path_fallback(monkeypatch) -> None:
envs = ["XDG_DATA_HOME", "XDG_STATE_HOME", "XDG_CONFIG_HOME", "XDG_CACHE_HOME"]
for env in envs:
monkeypatch.setenv(env, "/etc/dzgui")
paths = get_xdg_paths()
assert paths["XDG_CONFIG_HOME"] == Path.home().joinpath(".config/dzgui")
assert paths["XDG_STATE_HOME"] == Path.home().joinpath(".local/state/dzgui")
assert paths["XDG_DATA_HOME"] == Path.home().joinpath(".local/share/dzgui")
assert paths["XDG_CACHE_HOME"] == Path.home().joinpath(".cache/dzgui")