mirror of
https://github.com/aclist/dztui.git
synced 2026-10-31 15:12:48 +01:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
12e91c4ba8 |
No files matched your search
@@ -90,7 +90,6 @@
|
|||||||
- Rare segfaults when changing maps (threading)
|
- Rare segfaults when changing maps (threading)
|
||||||
- Moved dialogs out of threads
|
- Moved dialogs out of threads
|
||||||
- History table not being in lock-step with state file
|
- History table not being in lock-step with state file
|
||||||
- Current keyword filter not being applied when refreshing table
|
|
||||||
|
|
||||||
### Unreleased
|
### Unreleased
|
||||||
- Load offline mods
|
- Load offline mods
|
||||||
|
|||||||
@@ -346,15 +346,10 @@ def get_details(record: Record) -> Details:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
dlc = rules.dlc_flags
|
dlc = rules.dlc_flags
|
||||||
match dlc:
|
if dlc == 0:
|
||||||
case 0:
|
dlc = strings.none
|
||||||
dlc = strings.dlc_none
|
if dlc == 2:
|
||||||
case 2:
|
dlc = strings.dlc_frostline
|
||||||
dlc = strings.dlc_frostline
|
|
||||||
case 3:
|
|
||||||
dlc = strings.dlc_badlands
|
|
||||||
case _:
|
|
||||||
dlc = strings.unspecified
|
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
dlc = strings.unspecified
|
dlc = strings.unspecified
|
||||||
|
|
||||||
|
|||||||
+9
-16
@@ -151,9 +151,7 @@ def get_remote_signatures(mods: list[str]) -> list[tuple[str, str, int, int]]:
|
|||||||
return hashes
|
return hashes
|
||||||
|
|
||||||
|
|
||||||
def connect_debug(
|
def connect_debug(client: str, addr: str, appid: int, name: str, mods: list[str]) -> str:
|
||||||
client: str, addr: str, appid: int, name: str, mods: list[str]
|
|
||||||
) -> str:
|
|
||||||
concat = concat_mods(mods)
|
concat = concat_mods(mods)
|
||||||
client_args = concat_bash_args(client)
|
client_args = concat_bash_args(client)
|
||||||
params = [
|
params = [
|
||||||
@@ -169,7 +167,6 @@ def connect_debug(
|
|||||||
client_args.extend(params)
|
client_args.extend(params)
|
||||||
return " ".join(client_args)
|
return " ".join(client_args)
|
||||||
|
|
||||||
|
|
||||||
# TODO: set config to name=user, use official server and no mods,
|
# TODO: set config to name=user, use official server and no mods,
|
||||||
# ensure that formatted string is identical to fixture with same hash
|
# 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:
|
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:
|
try:
|
||||||
with open(resolved_path, "r") as f:
|
with open(resolved_path, "r") as f:
|
||||||
v = vdf.load(f)
|
v = vdf.load(f)
|
||||||
users = v["users"]
|
# NOTE: beta client
|
||||||
# NOTE: beta client: /package/beta
|
# /package/beta
|
||||||
last_user = str(next(iter(users)))
|
if len(v["users"]) == 1:
|
||||||
if len(users) == 1:
|
return str(list(v["users"].keys())[0])
|
||||||
return last_user
|
for user in v["users"]:
|
||||||
last_stamp = int(users[last_user]["Timestamp"])
|
if v["users"][user]["MostRecent"] == "1":
|
||||||
for user in users:
|
return str(user)
|
||||||
stamp = int(users[user]["Timestamp"])
|
return None
|
||||||
if stamp > last_stamp:
|
|
||||||
last_stamp = stamp
|
|
||||||
last_user = user
|
|
||||||
return last_user
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.debug(e)
|
logger.debug(e)
|
||||||
return None
|
return None
|
||||||
|
|||||||
@@ -523,7 +523,6 @@ class Controller(GObject.GObject):
|
|||||||
|
|
||||||
def set_start_tab(self) -> None:
|
def set_start_tab(self) -> None:
|
||||||
ind = self.config_man.get_start_tab()
|
ind = self.config_man.get_start_tab()
|
||||||
logger.info(f"Setting start tab to index {ind}")
|
|
||||||
self.get_servers().notebook.set_current_page(ind)
|
self.get_servers().notebook.set_current_page(ind)
|
||||||
|
|
||||||
def get_debug_args(self) -> str:
|
def get_debug_args(self) -> str:
|
||||||
|
|||||||
@@ -90,7 +90,6 @@
|
|||||||
- Rare segfaults when changing maps (threading)
|
- Rare segfaults when changing maps (threading)
|
||||||
- Moved dialogs out of threads
|
- Moved dialogs out of threads
|
||||||
- History table not being in lock-step with state file
|
- History table not being in lock-step with state file
|
||||||
- Current keyword filter not being applied when refreshing table
|
|
||||||
|
|
||||||
### Unreleased
|
### Unreleased
|
||||||
- Load offline mods
|
- Load offline mods
|
||||||
|
|||||||
@@ -259,6 +259,10 @@ class ProxyModelManager:
|
|||||||
def set_cache(self, filters: tuple[str], filtered_rows: list[tuple]) -> None:
|
def set_cache(self, filters: tuple[str], filtered_rows: list[tuple]) -> None:
|
||||||
self.filter_cache[filters] = filtered_rows
|
self.filter_cache[filters] = filtered_rows
|
||||||
|
|
||||||
|
# @deprecated("Currently unused")
|
||||||
|
# def convert_model_to_list(self, model: "FastInsertListStore") -> list:
|
||||||
|
# return [[el for el in row] for row in model]
|
||||||
|
|
||||||
def set_filtered(self, rows: list | None) -> None:
|
def set_filtered(self, rows: list | None) -> None:
|
||||||
if rows is None:
|
if rows is None:
|
||||||
self.filtered = []
|
self.filtered = []
|
||||||
@@ -294,6 +298,4 @@ class ProxyModelManager:
|
|||||||
def push(self, data: list[Any]) -> None:
|
def push(self, data: list[Any]) -> None:
|
||||||
self.wipe_cache()
|
self.wipe_cache()
|
||||||
self.set_control(data)
|
self.set_control(data)
|
||||||
cur_keyword = self.filter_man.get_active_keyword()
|
self.filter(FilterMode.INITIAL)
|
||||||
mode = FilterMode.TOGGLE_ON if len(cur_keyword) > 0 else FilterMode.INITIAL
|
|
||||||
self.filter(mode)
|
|
||||||
@@ -84,5 +84,6 @@ class CalcDist:
|
|||||||
except Exception:
|
except Exception:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
# TODO: handle failed remote dist
|
||||||
haversine = Haversine(local.lat, local.lon, remote.lat, remote.lon)
|
haversine = Haversine(local.lat, local.lon, remote.lat, remote.lon)
|
||||||
return haversine
|
return haversine
|
||||||
+9
-1
@@ -2,13 +2,14 @@ import a2s
|
|||||||
import requests
|
import requests
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
|
from warnings import deprecated
|
||||||
|
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from dzgui.api.servers import Record
|
from dzgui.api.servers import Record
|
||||||
from dzgui.const.constants import REQUEST_TIMEOUT
|
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:
|
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:
|
if not port.isdigit() or int(port) == 0 or int(port[0]) == 0 or int(port) > 65535:
|
||||||
return True
|
return True
|
||||||
return False
|
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
|
||||||
@@ -168,12 +168,11 @@ none_provided = "None provided"
|
|||||||
disabled = "Disabled"
|
disabled = "Disabled"
|
||||||
enabled = "Enabled"
|
enabled = "Enabled"
|
||||||
null = "-"
|
null = "-"
|
||||||
|
none = "None"
|
||||||
unspecified = "not specified"
|
unspecified = "not specified"
|
||||||
|
|
||||||
# DLC
|
# DLC
|
||||||
dlc_frostline = "Frostline"
|
dlc_frostline = "Frostline"
|
||||||
dlc_badlands = "Badlands"
|
|
||||||
dlc_none = "None"
|
|
||||||
|
|
||||||
# platform
|
# platform
|
||||||
windows = "Windows"
|
windows = "Windows"
|
||||||
|
|||||||
@@ -496,7 +496,8 @@ class Assistant(Gtk.Assistant):
|
|||||||
if page.is_migrated():
|
if page.is_migrated():
|
||||||
sp = page.migrated_conf["default_steam_path"]
|
sp = page.migrated_conf["default_steam_path"]
|
||||||
self.page_shortcuts.set_steam_path(sp)
|
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()
|
return self.get_final_page()
|
||||||
case SteamPathPage():
|
case SteamPathPage():
|
||||||
self.config_values["default_steam_path"] = page.get_path_from_radio()
|
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["name"] = name
|
||||||
self.config_values["use_miles"] = use_miles
|
self.config_values["use_miles"] = use_miles
|
||||||
self.config_values["client"] = client
|
self.config_values["client"] = client
|
||||||
|
self.write_config(self.config_values)
|
||||||
self.page_shortcuts.set_steam_path(
|
self.page_shortcuts.set_steam_path(
|
||||||
self.config_values["default_steam_path"]
|
self.config_values["default_steam_path"]
|
||||||
)
|
)
|
||||||
|
self.setup_complete = True
|
||||||
case ShortcutCreationPage():
|
case ShortcutCreationPage():
|
||||||
page.create_shortcuts()
|
page.create_shortcuts()
|
||||||
case _:
|
case _:
|
||||||
@@ -562,10 +565,6 @@ class Assistant(Gtk.Assistant):
|
|||||||
if not isinstance(page, IntroductionPage):
|
if not isinstance(page, IntroductionPage):
|
||||||
EMITTER.emit("step_pending")
|
EMITTER.emit("step_pending")
|
||||||
|
|
||||||
if page == self.page_completion:
|
|
||||||
self.write_config(self.config_values)
|
|
||||||
self.setup_complete = True
|
|
||||||
|
|
||||||
|
|
||||||
class CheckboxWithLabel(Gtk.Box):
|
class CheckboxWithLabel(Gtk.Box):
|
||||||
def __init__(self, text: str, blurb_text: str) -> None:
|
def __init__(self, text: str, blurb_text: str) -> None:
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ description = "DayZ server browser and mod manager for Linux"
|
|||||||
authors = [
|
authors = [
|
||||||
{name = "aclist"}
|
{name = "aclist"}
|
||||||
]
|
]
|
||||||
version = "7.0.0b23"
|
version = "7.0.0b22"
|
||||||
license = "GPL-3.0-or-later"
|
license = "GPL-3.0-or-later"
|
||||||
license-files = ["LICENSE"]
|
license-files = ["LICENSE"]
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
|||||||
@@ -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"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -20,6 +20,6 @@
|
|||||||
"SkipOfflineModeWarning" "0"
|
"SkipOfflineModeWarning" "0"
|
||||||
"AllowAutoLogin" "1"
|
"AllowAutoLogin" "1"
|
||||||
"MostRecent" "1"
|
"MostRecent" "1"
|
||||||
"Timestamp" "10"
|
"Timestamp" "0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -14,8 +14,6 @@ pytestmark = pytest.mark.apitest
|
|||||||
("api/loginusers_legacy_client.vdf", 0),
|
("api/loginusers_legacy_client.vdf", 0),
|
||||||
("api/loginusers_legacy_client_multiple.vdf", 1),
|
("api/loginusers_legacy_client_multiple.vdf", 1),
|
||||||
("api/loginusers_beta_client.vdf", 0),
|
("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:
|
def test_loginusers(monkeypatch, fixture: str, expect: int) -> None:
|
||||||
|
|||||||
@@ -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")
|
|
||||||
Reference in new issue
Block a user