-
Notifications
You must be signed in to change notification settings - Fork 671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MultiServer: add all worlds goal completion message #2956
Changes from 2 commits
20b48ba
30f7ab0
3a5242c
0bf2934
63ceb16
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -1839,6 +1839,15 @@ 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) | ||||||||||||||||||||||||
relevant_players = [player for player in ctx.player_names | ||||||||||||||||||||||||
if player[0] == client.team and player[1] != client.slot] | ||||||||||||||||||||||||
for player in relevant_players: | ||||||||||||||||||||||||
if player not in ctx.client_game_state: | ||||||||||||||||||||||||
break # player has yet to ever connect to the server | ||||||||||||||||||||||||
if ctx.client_game_state[player] != ClientStatus.CLIENT_GOAL: | ||||||||||||||||||||||||
break | ||||||||||||||||||||||||
else: | ||||||||||||||||||||||||
ctx.broadcast_text_all(f"Team #{client.team + 1} has completed all of their games! Congratulations!") | ||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
didn't test, just wrote it up in github. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You'd need to ignore the current player (since ctx.client_game_state is not changed yet), but this probably works. I'll test it soon. |
||||||||||||||||||||||||
|
||||||||||||||||||||||||
ctx.client_game_state[client.team, client.slot] = new_status | ||||||||||||||||||||||||
ctx.on_client_status_change(client.team, client.slot) | ||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe
rest_of_team
orother_players_in_team
would be even clearer?