1
0
Fork 0
mirror of synced 2024-06-02 02:34:40 +12:00

Revert "Lgndr: Undo bind_ip changes"

This reverts commit 7979563cb5.
This commit is contained in:
loathingKernel 2023-12-10 12:09:26 +02:00
parent 0241bec7b6
commit 6daee29c24
No known key found for this signature in database
GPG key ID: CE0C72D0B53821FD
4 changed files with 11 additions and 4 deletions

View file

@ -201,7 +201,8 @@ class LegendaryCLI(LegendaryCLIReal):
disable_delta=args.disable_delta,
override_delta_manifest=args.override_delta_manifest,
preferred_cdn=args.preferred_cdn,
disable_https=args.disable_https)
disable_https=args.disable_https,
bind_ip=args.bind_ip)
# game is either up-to-date or hasn't changed, so we have nothing to do
if not analysis.dl_size and not game.is_dlc:

View file

@ -125,7 +125,7 @@ class LegendaryCore(LegendaryCoreReal):
repair: bool = False, repair_use_latest: bool = False,
disable_delta: bool = False, override_delta_manifest: str = '',
egl_guid: str = '', preferred_cdn: str = None,
disable_https: bool = False) -> (DLManager, AnalysisResult, ManifestMeta):
disable_https: bool = False, bind_ip: str = None) -> (DLManager, AnalysisResult, ManifestMeta):
dlm, analysis, igame = super(LegendaryCore, self).prepare_download(
game=game, base_game=base_game, base_path=base_path,
status_q=status_q, max_shm=max_shm, max_workers=max_workers,
@ -138,7 +138,7 @@ class LegendaryCore(LegendaryCoreReal):
repair=repair, repair_use_latest=repair_use_latest,
disable_delta=disable_delta, override_delta_manifest=override_delta_manifest,
egl_guid=egl_guid, preferred_cdn=preferred_cdn,
disable_https=disable_https
disable_https=disable_https, bind_ip=bind_ip,
)
# lk: monkeypatch run_real (the method that emits the stats) into DLManager
# pylint: disable=E1111

View file

@ -40,10 +40,15 @@ class DLManager(DLManagerReal):
self.writer_result_q = MPQueue(-1)
self.log.info(f'Starting download workers...')
bind_ip = None
for i in range(self.max_workers):
if self.bind_ips:
bind_ip = self.bind_ips[i % len(self.bind_ips)]
w = DLWorker(f'DLWorker {i + 1}', self.dl_worker_queue, self.dl_result_q,
self.shared_memory.name, logging_queue=self.logging_queue,
dl_timeout=self.dl_timeout)
dl_timeout=self.dl_timeout, bind_addr=bind_ip)
self.children.append(w)
w.start()

View file

@ -86,6 +86,7 @@ class LgndrInstallGameArgs:
reset_sdl: bool = False
skip_sdl: bool = False
disable_https: bool = False
bind_ip: str = ""
# FIXME: move to LgndrInstallGameRealArgs
skip_dlcs: bool = False
with_dlcs: bool = False