Various changes, block telemetry feature.
-Sp/--patch is now required to do block telemetry before patching. Still preparing for hdiffpatch (will be coming at 1.10) Ay yo hosty support coming soon xD
This commit is contained in:
@ -37,6 +37,24 @@ class UI:
|
||||
def get_game_version(self):
|
||||
print(self._installer.get_game_version())
|
||||
|
||||
def block_telemetry(self):
|
||||
print("Checking for available telemetry to block...")
|
||||
try:
|
||||
asyncio.run(self._patcher.block_telemetry())
|
||||
except ValueError:
|
||||
print("No telemetry to block.")
|
||||
else:
|
||||
print("Telemetry blocked.")
|
||||
|
||||
def check_telemetry(self):
|
||||
block_status = asyncio.run(self._patcher.is_telemetry_blocked())
|
||||
if not block_status:
|
||||
print("Telemetry is blocked.")
|
||||
else:
|
||||
print("Telemetry is not blocked, you need to block these hosts below.")
|
||||
for block in block_status:
|
||||
print(block)
|
||||
|
||||
def _update_from_archive(self, filepath):
|
||||
print("Reverting patches if patched...")
|
||||
self._patcher.revert_patch(True)
|
||||
@ -72,11 +90,13 @@ class UI:
|
||||
if not self._ask("Do you want to patch the game? (This will overwrite your game files!)"):
|
||||
print("Aborting patch process.")
|
||||
return
|
||||
print("Patching game...")
|
||||
self.block_telemetry()
|
||||
print("Updating patches...")
|
||||
asyncio.run(self._patcher.download_patch())
|
||||
print("Patching game...")
|
||||
self._patcher.apply_patch(login_fix)
|
||||
print("Game patched.")
|
||||
print("Please refrain from sharing this project to public especially official channels, thank you.")
|
||||
print("Please refrain from sharing this project to public, thank you.")
|
||||
|
||||
def install_from_file(self, filepath):
|
||||
gamever = self._installer.get_game_version()
|
||||
@ -96,6 +116,10 @@ class UI:
|
||||
self._install_from_archive(filepath, False)
|
||||
print("Game installed successfully.")
|
||||
|
||||
def download_patch(self):
|
||||
print("Downloading patches...")
|
||||
asyncio.run(self._patcher.download_patch())
|
||||
|
||||
def download_game(self):
|
||||
print("Downloading full game (This will take a long time)...")
|
||||
asyncio.run(self._installer.download_full_game())
|
||||
@ -235,6 +259,7 @@ def main():
|
||||
parser.add_argument("-Rv", "--remove-voiceover", action="store_true", help="Remove a Voiceover pack (if installed)")
|
||||
parser.add_argument("--get-game-version", action="store_true", help="Get the current game version")
|
||||
parser.add_argument("--no-overseas", action="store_true", help="Don't use overseas server")
|
||||
parser.add_argument("--check-telemetry", action="store_true", help="Check for the telemetry information")
|
||||
parser.add_argument("--from-ver", action="store", help="Override the detected game version", type=str, default=None)
|
||||
parser.add_argument("--noconfirm", action="store_true",
|
||||
help="Do not ask any for confirmation. (Ignored in interactive mode)")
|
||||
@ -243,7 +268,8 @@ def main():
|
||||
args.remove and not args.remove_patch and not args.remove_voiceover and not args.get_game_version and not \
|
||||
args.install_voiceover_from_file and not args.update_voiceover and not args.download_game and not \
|
||||
args.download_voiceover and not args.download_game_update and not args.download_voiceover_update and not \
|
||||
args.install_voiceover_from_file and not args.update_all and not args.login_fix
|
||||
args.install_voiceover_from_file and not args.update_all and not args.login_fix and not args.check_telemetry\
|
||||
and not args.from_ver
|
||||
if args.temporary_dir:
|
||||
args.temporary_dir.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
@ -261,9 +287,15 @@ def main():
|
||||
if args.install_from_file and args.install:
|
||||
raise ValueError("Cannot specify both --install-from-file and --install arguments.")
|
||||
|
||||
if args.from_ver:
|
||||
ui.override_game_version(args.from_ver)
|
||||
|
||||
if args.get_game_version:
|
||||
ui.get_game_version()
|
||||
|
||||
if args.check_telemetry:
|
||||
ui.check_telemetry()
|
||||
|
||||
if args.download_game:
|
||||
ui.download_game()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user