Skip to content

Commit 0d35cd4

Browse files
authored
BizHawkClient: Avoid error launching BizHawkClient via Launcher CLI (#3554)
* Core, BizHawkClient: Support launching BizHawkClient via Launcher command line * Revert changes to LauncherComponents.py
1 parent db5d9fb commit 0d35cd4

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

BizHawkClient.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
from __future__ import annotations
22

3+
import sys
34
import ModuleUpdate
45
ModuleUpdate.update()
56

67
from worlds._bizhawk.context import launch
78

89
if __name__ == "__main__":
9-
launch()
10+
launch(*sys.argv[1:])

worlds/_bizhawk/client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
def launch_client(*args) -> None:
1717
from .context import launch
18-
launch_subprocess(launch, name="BizHawkClient")
18+
launch_subprocess(launch, name="BizHawkClient", args=args)
1919

2020

2121
component = Component("BizHawk Client", "BizHawkClient", component_type=Type.CLIENT, func=launch_client,

worlds/_bizhawk/context.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,11 @@ async def _patch_and_run_game(patch_file: str):
239239
logger.exception(exc)
240240

241241

242-
def launch() -> None:
242+
def launch(*launch_args) -> None:
243243
async def main():
244244
parser = get_base_parser()
245245
parser.add_argument("patch_file", default="", type=str, nargs="?", help="Path to an Archipelago patch file")
246-
args = parser.parse_args()
246+
args = parser.parse_args(launch_args)
247247

248248
ctx = BizHawkClientContext(args.connect, args.password)
249249
ctx.server_task = asyncio.create_task(server_loop(ctx), name="ServerLoop")

0 commit comments

Comments
 (0)