about summary refs log tree commit diff stats
path: root/apworld/context.py
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2025-09-27 11:49:37 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2025-09-27 11:49:37 -0400
commit2125ccf715544d3703cadf064a85331de8b053e4 (patch)
treef5c784727d3ba02e4ee73f6b66d3d9f27a304e2e /apworld/context.py
parent86a5188548f80eab6bce3cb6686c49f8448683db (diff)
downloadlingo2-archipelago-2125ccf715544d3703cadf064a85331de8b053e4.tar.gz
lingo2-archipelago-2125ccf715544d3703cadf064a85331de8b053e4.tar.bz2
lingo2-archipelago-2125ccf715544d3703cadf064a85331de8b053e4.zip
Automatically close client when clicking Quit
Diffstat (limited to 'apworld/context.py')
-rw-r--r--apworld/context.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/apworld/context.py b/apworld/context.py index 2a2149f..41e833e 100644 --- a/apworld/context.py +++ b/apworld/context.py
@@ -267,6 +267,8 @@ async def process_game_cmd(ctx: Lingo2GameContext, args: dict):
267 async_start(ctx.client.disconnect(), name="client disconnect") 267 async_start(ctx.client.disconnect(), name="client disconnect")
268 elif cmd in ["Sync", "LocationChecks", "Say", "StatusUpdate", "LocationScouts"]: 268 elif cmd in ["Sync", "LocationChecks", "Say", "StatusUpdate", "LocationScouts"]:
269 async_start(ctx.client.send_msgs([args]), name="client forward") 269 async_start(ctx.client.send_msgs([args]), name="client forward")
270 elif cmd == "Quit":
271 ctx.client.exit_event.set()
270 272
271 273
272async def run_game(): 274async def run_game():
@@ -328,6 +330,7 @@ def client_main(*launch_args: str) -> None:
328 logger.exception(e) 330 logger.exception(e)
329 331
330 await client_ctx.exit_event.wait() 332 await client_ctx.exit_event.wait()
333 client_ctx.ui.stop()
331 await client_ctx.shutdown() 334 await client_ctx.shutdown()
332 335
333 Utils.init_logging("Lingo2Client", exception_logger="Client") 336 Utils.init_logging("Lingo2Client", exception_logger="Client")