diff --git a/AHITClient.py b/AHITClient.py index 6ed7d7b4..edcbbd84 100644 --- a/AHITClient.py +++ b/AHITClient.py @@ -1,3 +1,4 @@ +import sys from worlds.ahit.Client import launch import Utils import ModuleUpdate @@ -5,4 +6,4 @@ ModuleUpdate.update() if __name__ == "__main__": Utils.init_logging("AHITClient", exception_logger="Client") - launch() + launch(*sys.argv[1:]) diff --git a/worlds/ahit/Client.py b/worlds/ahit/Client.py index 0a9d8d60..64c1124f 100644 --- a/worlds/ahit/Client.py +++ b/worlds/ahit/Client.py @@ -238,10 +238,10 @@ async def proxy_loop(ctx: AHITContext): logger.info("Aborting AHIT Proxy Client due to errors") -def launch(): +def launch(*launch_args: str): async def main(): parser = get_base_parser() - args = parser.parse_args() + args = parser.parse_args(launch_args) ctx = AHITContext(args.connect, args.password) logger.info("Starting A Hat in Time proxy server") diff --git a/worlds/ahit/__init__.py b/worlds/ahit/__init__.py index 16b54064..1bcc840a 100644 --- a/worlds/ahit/__init__.py +++ b/worlds/ahit/__init__.py @@ -16,9 +16,9 @@ from worlds.LauncherComponents import Component, components, icon_paths, launch from Utils import local_path -def launch_client(): +def launch_client(*args: str): from .Client import launch - launch_component(launch, name="AHITClient") + launch_component(launch, name="AHITClient", args=args) components.append(Component("A Hat in Time Client", "AHITClient", func=launch_client,