AHiT: Fix Client Argument Handling (#4992)

This commit is contained in:
Duck
2025-05-14 05:18:36 -06:00
committed by GitHub
parent 0994afa25b
commit b71c8005e7
3 changed files with 6 additions and 5 deletions

View File

@@ -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:])

View File

@@ -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")

View File

@@ -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,