From 653e1ff924200d608c22a7e635b3dd19db897098 Mon Sep 17 00:00:00 2001 From: Silvris <58583688+Silvris@users.noreply.github.com> Date: Sun, 14 Apr 2024 13:16:45 -0500 Subject: [PATCH] MultiServer: add all worlds goal completion message (#2956) --- MultiServer.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/MultiServer.py b/MultiServer.py index f12e96c8fbf4..4c9076b11974 100644 --- a/MultiServer.py +++ b/MultiServer.py @@ -1837,6 +1837,11 @@ def update_client_status(ctx: Context, client: Client, new_status: ClientStatus) if current != ClientStatus.CLIENT_GOAL: # can't undo goal completion if new_status == ClientStatus.CLIENT_GOAL: ctx.on_goal_achieved(client) + # if player has yet to ever connect to the server, they will not be in client_game_state + if all(player in ctx.client_game_state and ctx.client_game_state[player] == ClientStatus.CLIENT_GOAL + for player in ctx.player_names + if player[0] == client.team and player[1] != client.slot): + ctx.broadcast_text_all(f"Team #{client.team + 1} has completed all of their games! Congratulations!") ctx.client_game_state[client.team, client.slot] = new_status ctx.on_client_status_change(client.team, client.slot)