Compare commits

..

2 Commits

Author SHA1 Message Date
68a598410b cli/hsr: add telemetry check text 2023-06-25 22:16:07 +07:00
af92a28d94 fix: wrong import 2023-06-25 22:02:08 +07:00
2 changed files with 10 additions and 2 deletions

View File

@ -82,8 +82,10 @@ class HSR:
if not ask("Do you still want to patch?"): if not ask("Do you still want to patch?"):
print("Patching aborted.") print("Patching aborted.")
return return
print("Checking telemetry hosts...", end=" ")
telemetry_list = self._patcher.check_telemetry() telemetry_list = self._patcher.check_telemetry()
if telemetry_list: if telemetry_list:
print("FOUND")
print("Telemetry hosts found: ") print("Telemetry hosts found: ")
for host in telemetry_list: for host in telemetry_list:
print(f" - {host}") print(f" - {host}")
@ -100,6 +102,8 @@ class HSR:
print("Cannot continue, please block them manually then try again.") print("Cannot continue, please block them manually then try again.")
return return
print("Continuing anyway...") print("Continuing anyway...")
else:
print("OK")
if not self.__update_patch(): if not self.__update_patch():
return return
match self._patcher.patch_type: match self._patcher.patch_type:

View File

@ -3,7 +3,7 @@ from os import PathLike
from pathlib import Path from pathlib import Path
from enum import Enum from enum import Enum
from vollerei.abc.launcher.game import GameABC from vollerei.abc.launcher.game import GameABC
from vollerei.hsr.constants import md5sums from vollerei.hsr.constants import MD5SUMS
class GameChannel(Enum): class GameChannel(Enum):
@ -12,6 +12,10 @@ class GameChannel(Enum):
class Game(GameABC): class Game(GameABC):
"""
Manages the game installation
"""
def __init__(self, path: PathLike = None): def __init__(self, path: PathLike = None):
self._path: Path | None = Path(path) if path else None self._path: Path | None = Path(path) if path else None
self._version_override: tuple[int, int, int] | None = None self._version_override: tuple[int, int, int] | None = None
@ -166,7 +170,7 @@ class Game(GameABC):
""" """
version = self._version_override or self.get_version() version = self._version_override or self.get_version()
if version == (1, 0, 5): if version == (1, 0, 5):
for channel, v in md5sums["1.0.5"].values(): for channel, v in MD5SUMS["1.0.5"].values():
for file, md5sum in v.values(): for file, md5sum in v.values():
if ( if (
md5(self._path.joinpath(file).read_bytes()).hexdigest() md5(self._path.joinpath(file).read_bytes()).hexdigest()