floatinghotpot / casino-server

:fire: An online poker game server powered by Redis, node.js and socket.io
MIT License
1.06k stars 471 forks source link

Players with a negative balance can blind bet.. #11

Open G-h-o-s-t opened 9 years ago

G-h-o-s-t commented 9 years ago

Once the game is over and someone lost everything to zero, they still at the table.

And the player with zero balance can press ready(!), the game begins, zero balance will turn into a negative (because of the blind bets). Can server throw players with a negative or zero balance from the table, after the game ends?

G-h-o-s-t commented 9 years ago

Also this situation throw the error (then no cards are dealt) in Holdem poker

main.js:1003 Holdem.sort = function(cards) { if(cards.length != 5) return cards; // Uncaught TypeError: Cannot read property 'length' of null ...

I'm understand that is a front-end error, but i type it just for info reason. The easest cure - add cards array check before comparing. ( if(!cards) return; )

thx.

floatinghotpot commented 9 years ago

@G-h-o-s-t thanks for the bug report. Will look into the first two issues.

As to Holdem.sort(), the param cards should be an array, which means a set of cards, should not be null, if no cards, just pass an empty array.

G-h-o-s-t commented 9 years ago

Okay, got you. Thanks for you support!

zilveer commented 7 years ago

@floatinghotpot did you solve this issue?