-
Notifications
You must be signed in to change notification settings - Fork 9
Description
There are a few issues with the current bet system where coins are only taken when the game is finished and we lose.
For example, someone with 1000 tokens can join 2 games, bet 1000 in both then start both games. If they lose both they should technically lose 2000 but they won't be able to, so they "cheat".
This can be quite easily fixed by having GameService check current active games where the player is in, and deducting the current bet for these games to the balance when checking if the player has enough to bet in another game.
Another issue is certains games allow increasing the bet during the game.
For example, in Poker when you Bet/Call/Raise. Or in Blackjack when you DoubleDown.
Currently we touch the Bet attribute of the GamePlayer class, but that doesn't check Balance. A player with 1000 can bet all in Blackjack, then DoubleDown to bet 2000 even if he doesn't have 2000.
The betting system needs to be expanded to handle such cases.