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

Showdown cleared on table that initiates synchronized breaks #1474

Open
ctm opened this issue Jul 23, 2024 · 4 comments
Open

Showdown cleared on table that initiates synchronized breaks #1474

ctm opened this issue Jul 23, 2024 · 4 comments
Assignees
Labels
bug Something isn't working high priority Should be done fairly soon regression Something that formerly worked

Comments

@ctm
Copy link
Owner

ctm commented Jul 23, 2024

Fix so the showdown isn't wiped as soon as the table goes on break.

This just happened to me at https://craftpoker.com/event/5423/player/10 I've seen it before. This was on table 5963

@ctm ctm added bug Something isn't working high priority Should be done fairly soon easy Trivial to do (even when tired!) and semi-worthwhile labels Jul 23, 2024
@ctm ctm self-assigned this Jul 23, 2024
@ctm ctm added the regression Something that formerly worked label Jul 25, 2024
@ctm
Copy link
Owner Author

ctm commented Jul 25, 2024

FWIW, the issue is that players' cards are swept before the status is sent, so we get these messages:

 11231933 | 2024-07-22 18:55:39.92534  |     5963 |  416688 | {"EndOfHand": ...
 11231934 | 2024-07-22 18:55:39.930665 |     5963 |  416688 | {"OnLevel": ["Break", ...
 11231935 | 2024-07-22 18:55:39.939607 |     5963 |  416688 | {"Status" ...

EndOfHand has enough information to show who won and with what, but the Status that comes after the OnLevel no longer has people's cards, so the UI clears that info, essentially instantaneously.

IIRC, mb2 didn't always do this, but it's been doing it for a while. I don't think the solution is to simply not clear players' cards where we do. I think the problem is we elide the three second EndOfHand Pause. So, the solution depends on what behavior we want. Do we want the cards to remain in view during the entire break or do we just want to show them for three seconds?

I probably won't do any more work on this issue today.

@ctm ctm closed this as completed Jul 25, 2024
@ctm
Copy link
Owner Author

ctm commented Jul 26, 2024

Oops. Didn't mean to close this one.

@ctm ctm reopened this Jul 26, 2024
@ctm
Copy link
Owner Author

ctm commented Aug 1, 2024

For now, we want the hand before the break to be just like all the other hands: a three second (for now; customizable later) display of the showdown information before the players' cards are swept.

The implementation should be fairly easy; just move the code that initiates a synchronized break from the end of a hand to the end of the relevant pauses. I'll have to double-check the way we do pauses, because we have both EndOfHand and PlayerBust and I think we'd need to initiate from either of those, but not from any of the other Pause variants. OTOH, both of those put a NextAction::EndOfHand message in the action channel, so perhaps that can be used. Unfortunately, we currently make the selection of the next Dealer's Choice game a hand unto itself (#1479), and that complicates the issue.

@ctm ctm removed the easy Trivial to do (even when tired!) and semi-worthwhile label Aug 1, 2024
@ctm
Copy link
Owner Author

ctm commented Aug 1, 2024

This is trickier than I had thought, so I've stripped the easy label.

Table is in control of notify_tournament_of_finished_hand, which is monitored in showdown. If it's set there, then a HandFinished message is sent to the RunningEvent. That's used both to potentially start a synchronized break as well as to redraw to the final table. However, prior to examining notify_tournament_of_finished_hand, self.pause(...) has already been called (with either a PlayerBust, GameChosen (ugh!) or EndOfHand).

I think we can just add a bool element to the NextAction::EndHand variant and set that to the value of notify_tournament_of_finished_hand in Table::pause and then check that element when we get a NextAction::EndHand, but I'm a little nervous that we might miss something if we decide we need to start a synchronized break or redraw to the final table in a slightly different place than we're doing it now.

FWIW, currently EndHand does the total chip sanity check (which can be done any time, since chips in play are counted) and then potentially does a rebalance. I think both of those are skipped for the end of the hand that initiates synchronized breaks or that initiates a table draw, but that's due to my (possibly faulty) reading of the code.

So, I'll want to instrument action_timer to see if those pauses are really removed when notify_tournament_of_finished_hand does its thing.

This is sufficiently complex that I need to work on it with a solid block of time. I don't know if I'll have that today, because mom is getting up ten minutes late and I don't know how she's going to feel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high priority Should be done fairly soon regression Something that formerly worked
Projects
None yet
Development

No branches or pull requests

1 participant