Skip to content

games: Stop sending pages to players who forfeited#70

Merged
PartMan7 merged 4 commits intoPartMan7:mainfrom
Audiino:interface
Jul 7, 2025
Merged

games: Stop sending pages to players who forfeited#70
PartMan7 merged 4 commits intoPartMan7:mainfrom
Audiino:interface

Conversation

@Audiino
Copy link
Collaborator

@Audiino Audiino commented Jul 1, 2025

No description provided.

@PartMan7 PartMan7 linked an issue Jul 1, 2025 that may be closed by this pull request
return game.update(user);
}
if (game.spectators.includes(user)) {
if (game.spectators.includes(user) || (player && player.out)) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh oops

Issue here is that a player who's out won't be in spectators either. We might need to do something like:

  • Players are only sent HTML if player.out is not true
  • Players that should keep spectating even upon being out (eg: Chain Reaction) should be moved to game.spectators instead (and stuff like rejoin will have to be rechecked once to make sure player.out === true && spectators.includes(player) conditions are handled

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be able to remove the line here now

Also need to disable auto-updates for players that are out

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the line but not sure what you mean by the auto-updates? Since they become spectators shouldn't they also keep getting updates sent to them

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
(The second case is handled correctly but not the first, so if anything happens that tries to fire a rejoin, they'll be rendered as a full player)

@PartMan7
Copy link
Owner

PartMan7 commented Jul 7, 2025

Okay this looks great, thanks!

@PartMan7 PartMan7 changed the title interface: Stop sending game pages to players who forfeited games: Stop sending pages to players who forfeited Jul 7, 2025
@PartMan7 PartMan7 merged commit 1ec4737 into PartMan7:main Jul 7, 2025
4 checks passed
@Audiino Audiino deleted the interface branch July 12, 2025 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Games: Leaving a game doesn't let you close the page

2 participants