Skip to content
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

multi-games issue: timer timeout not working when player leaves #13

Open
barrybecker4 opened this issue Aug 1, 2021 · 3 comments
Open

Comments

@barrybecker4
Copy link
Owner

If 3 players are playing a game and one leaves, then the game is horked because the move of the player that left does not timeout. This is because the timer is running on the client and not the server.

Two options to solve:

  • have timer/timeout be on the server in addition to or instead of on the client.
  • Detect that a player leaves (when they click new game button or leave page) and send a signal that they have resigned. The result should be the same as if they are conquered. All their armies should be removed.
@barrybecker4
Copy link
Owner Author

Maybe we can add an explicit resign button to help with testing. When it works, then clicking new or leaving the page should be the same as clicking resign (if in an active game). Then the resign button could be removed.

@barrybecker4
Copy link
Owner Author

Instead of adding an additional "resign" button, we should change the nuclear "restart" button to the "resign" button.

@barrybecker4
Copy link
Owner Author

I changed the "reset" button at the bottom to "resign". The player can resign when it is their move.
If a player leaves during a game they will end up resigning after a timeout period. However, I don't think it will work if more than 1 player leaves at once. To do it correctly, we may want the timeout timer on the server.

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

No branches or pull requests

1 participant