ctm / mb2-doc

Mb2, poker software
https://devctm.com
7 stars 2 forks source link

Action "Muck" instead of nickname on break #1374

Closed ctm closed 3 months ago

ctm commented 3 months ago

Make it so if someone mucks just before the break starts, the "Muck" changes back to the username.

Screenshot 2024-03-29 at 18 57 39
ctm commented 3 months ago

The player name override code is more than a little hinky, in that Table contains a VecDeque<Timeout> override_timeouts field that is used to clean up the overrides, but the overrides themselves are in the player_name_override field of PlayerInfo and they simply contain a DateTime<Utc> that is checked when cleanup_player_name_override is called. This means that an override scheduled by the Table has the obligation of updating override_timeouts and ActionTracker itself has no way to do so. That may have worked when all the overrides were set from Table, but now there are a few that are set from ActionTracker.

The solution, of course, is to totally get rid of override_timeouts and put the Timeout in PlayerNameOverride (which is the struct that PlayerInfo uses for the other data about the override). That means we have to pass a callback for Table into ActionTracker.

I'll do this later today. It's trivial to do now, but I'd like to run a little and get cleaned up before heading out.

ctm commented 3 months ago

Fixed and merged into master. It'll go out with the next deploy, which I'll try to do before this evening's game.