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

Add user action between hands - the user can choose whether to quit the game or sit out the next hand #413

Open
piggydoughnut opened this issue Feb 10, 2021 · 8 comments

Comments

@piggydoughnut
Copy link
Collaborator

We should give players an option to sit out the next game. Just like they do in PokerStars.

To quit the game the player can just close the game window? Or there could be a dedicated quit game button, that can take the player back to the list of tables. @NutellaLicka What would be the best way for the player to quit the game? In poker stars you just close the window, but they have the game open in an extra window so the player just closes that extra window and chooses a new action from the main window.

Also should this go in the alpha release? @NutellaLicka This could probably be more of a beta material.

Screen Shot 2021-02-10 at 4 48 52 PM

@satindergrewal
Copy link

Yes, I see no reason of not targeting it for an alpha release.
It is actually the intended behaviour of playing a game online.

Once the game ends, the logic should be:

  • Ask user if he wants to Quit or Continue playing next game.
  • If continue, initialise the next game
  • If Quit, the player gets adjusted with the lightning transaction and the game exits to say Game ended etc.

For all of that I see the backend needs conditions added to make a conditional code there to push websocket message to the GUI of waiting for end user's action on next game play, and wait for that user's action, or timeout waiting for may be 1 minute. On timeout the game automatically ends, instead of continuing further.

I still need to check on all that logic of game further, but as I move forward, I'll see what I can find, understand and change in the code.

@NutellaLicka
Copy link

Yeah I'd say aim for alpha release unless it adds a massive overhead.

I think having a click button labelled something along the lines of "leave table next hand" would be handy. That way as soon as the hand is over, the player is removed from the table.

If somebody was to close the game window, this would also need to have the same affect. I think waiting 1 minute between hands is wayyy too long though (in the case somebody closes their window without clicking that button).

The game should assume people are playing the next hand, unless that box is ticked, or the player has closed the game (this could send a message to the dealer on closure).

@piggydoughnut
Copy link
Collaborator Author

Allright, from what I know of how PokerStars works, I can implement the following:

  • checkbox for the user to quit at the next hand. Hands roll one after another as this is how it is in PokerStars and I believe in any online poker. The player doesnt need to opt-in, they only need to opt-out.

What i need from the backend:

  • How do we handle this game exit? Maybe I could send a message to the backend that this given user wants to quit the game. There are a few things to take into consideration, I think, not sure though, there is a condition on the backend that the game starts if there is a certain number of players at the table. This condition should only be applied to the first hand, if I understand it right. @NutellaLicka please correct me if I am wrong. So basically if the player quits after the first hand, the game goes on, until there is only one player at the table coz everyone else quit (or there is only one player who s got all the cash). Right?

GUI -> backend {method: 'exit_game', playerId: 1}

  • GUI adds a log message that a player quite the game.
  • I redirect the user to the login window, table choosing/private ip screen.

backend -> GUI {method: 'seats', seats: []} https://github.com/chips-blockchain/bet/blob/master/docs/method_seats.md

  • I think seats method is pushed at the start of each hand, if it is not then it needs to be pushed at the start of each hand.
  • then I can update the seats to reflect that one player left the game

GUI:
If there is only one player left, he has to wait for more players to join to play. Backend should send some message to the GUI that there is less players than the limit and the GUI has to wait.
If there is more than one player the game continues. Backend doesnt have to do anything here.

@NutellaLicka
Copy link

This condition should only be applied to the first hand

No, this condition should be checked every single hand. Each hand is effectively a 'new game', as far as Cash poker goes. 3 people could 'stand up' or leave the table, and 2 sit down, between each hand. Or any combination of people staying or leaving the table.

@piggydoughnut
Copy link
Collaborator Author

so if the table needs 6 people to start playing, and one guy leaves after the first hand, everyone have to wait for a new person to join so they are 6 in total again? @NutellaLicka

@NutellaLicka
Copy link

If that is what the dealer sets the table too, then yes. It gives the dealer flexibility and options. Some people do not want to play poker with less than 6 people, some don't mind. Others wouldn't want to join a hand straight away if they were the 2nd person to sit down.

I personally would look at the minimum number of players and go to a table that is above that, so I can get onto the table and play straight away. But I wouldn't do that if the minimum number of players was, say, 4.

@piggydoughnut
Copy link
Collaborator Author

Design wise I guess it could be something like this. The player will see these options when its not his turn to play.
He can opt out to leave, sit out, fold.

Also I could add automatic options for playing - Call x, Call Any and Fold. That will be a different issue.

Chips sitout

with card

@piggydoughnut piggydoughnut changed the title Add user action between hands - the user can choose whether to quit the game or continue Add user action between hands - the user can choose whether to quit the game or sit out the next hand Mar 5, 2021
@piggydoughnut
Copy link
Collaborator Author

Within this issue the following will be implemented:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants