ctm / mb2-doc

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

card returned on draw in Archie #137

Closed ctm closed 4 years ago

ctm commented 4 years ago
NNR13 calls
1     JADC         28775 1800  [  ] [  ] [  ] [  ] [  ]
2 B  [maverick600]  8575[1200] 
3   > tombayz      15275 1800  [  ] [  ] [  ] [  ] [  ]
4     deadhead     22575 1800  [  ] [  ] [  ] [  ] [  ]
5    [samarai]     21975[1200] 
6     gerdog       15475 1800  [  ] [  ] [  ] [  ] [  ]
7     chuck        17175 1800  [  ] [  ] [  ] [  ] [  ]
8     NNR13        16975 1800  [  ] [  ] [  ] [  ] [  ]
                 My cards are: [8d] [Js] [Td] [6s] [9c]
The muck has been shuffled into the deck
tombayz draws 2
deadhead draws 1
gerdog draws 1
Cliff,
This is what happened (don't know if this helps or not).

You will discard: 6s
chuck draws 1
NNR13 draws 1
                 My cards are: [8d] [Js] [Td] [6s] [9c]
JADC draws 1
tombayz checks
We're now on Level 5
deadhead checks
gerdog checks
chuck bets 1200
It is 1200 to you
NNR13 folds
JADC calls
tombayz calls
deadhead calls
gerdog folds

Additionally:

tombayz: cliff something's really furked up, I have 2 six of spades in my hand right now
deadhead: ugh.
JADC checks
deadhead: Saddenz
maverick600 checks
tombayz: i had one and just drew one, sorry to bring the bad news
tombayz checks
1     JADC         21175 800  [  ] [  ] [  ] [  ] [  ]
2     maverick600   2175 800  [  ] [  ] [  ] [  ] [  ]
3     tombayz      13275 800  [  ] [  ] [  ] [  ] [  ]
4 B  [deadhead]    39175[  0] 
5    [samarai]     30375[400] 
6   > gerdog       12275 800  [  ] [  ] [  ] [  ] [  ]
7     chuck        20175 800  [  ] [  ] [  ] [  ] [  ]
8    [NNR13]       16975[  0] 
gerdog draws 3
maverick600: my kind of game 
gerdog: multi deck poker!!!!!
chuck draws 1
JADC draws 1
maverick600 draws 2
deadhead: If the bugs are there, I'm glad they're found by friends.
JADC: lol I'm looking for a 6
chuck: #metoo
samarai: see Nancy, you didn't get the same card back, you got the "other" 6s
deadhead: uh oh...
chuck: My thought exactly. :)
deadhead: looks like the game died.

I've saved my text log of the hand to a local file. I should also be able to spelunk through the JSONB logs.

ctm commented 4 years ago

It looks like the issue is that after we shuffle the muck back into the deck, we don't actually zero out the muck. So, under light testing, where we only hit the muck once, this never is an issue. However, if we ever have to go to the muck more than once, we start duplicating cards.

The above is from code inspection. I'll actually do a little testing, then fix it.

ctm commented 4 years ago

Actually, we do zero out the muck after shuffling it in. So, that wasn't the bug. I may need to poke around in the JSONB logs to figure out what happened.

ctm commented 4 years ago

Oh, my. I wasn't clearing the muck at the beginning of the hand. Fixed and deployed.