about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--apworld/client/client.gd4
-rw-r--r--apworld/client/main.gd1
-rw-r--r--apworld/context.py3
3 files changed, 8 insertions, 0 deletions
diff --git a/apworld/client/client.gd b/apworld/client/client.gd index 05b2b6c..286ad4b 100644 --- a/apworld/client/client.gd +++ b/apworld/client/client.gd
@@ -227,6 +227,10 @@ func scoutLocations(loc_ids):
227 sendMessage([{"cmd": "LocationScouts", "locations": loc_ids}]) 227 sendMessage([{"cmd": "LocationScouts", "locations": loc_ids}])
228 228
229 229
230func sendQuit():
231 sendMessage([{"cmd": "Quit"}])
232
233
230func hasItem(item_id): 234func hasItem(item_id):
231 return _received_items.has(item_id) 235 return _received_items.has(item_id)
232 236
diff --git a/apworld/client/main.gd b/apworld/client/main.gd index 9d66358..8425d8c 100644 --- a/apworld/client/main.gd +++ b/apworld/client/main.gd
@@ -137,6 +137,7 @@ func _connect_pressed():
137func _back_pressed(): 137func _back_pressed():
138 var ap = global.get_node("Archipelago") 138 var ap = global.get_node("Archipelago")
139 ap.disconnect_from_ap() 139 ap.disconnect_from_ap()
140 ap.client.sendQuit()
140 141
141 get_tree().quit() 142 get_tree().quit()
142 143
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")