dgw / sopel-UnoBot

Play UNO on IRC with the help of your Sopel bot!
Other
3 stars 3 forks source link

Omit held cards from newly generated decks #38

Open dgw opened 7 years ago

dgw commented 7 years ago

While working on #37 I had this thought: Why not omit cards that are out (in players' hands) from the generated deck?

Have to make a decision about how to handle cards that are held by players who left the game, because their cards are saved in case they rejoin (to prevent quit/join exploit for getting back down to 7). But it is trivial to go through the deck and remove each card held by every player, plus the top card on the discard pile.

dgw commented 7 years ago

Maybe stop remembering the exact cards of players who leave, and just store the number of cards they had? The point of that feature is to block the quit/join hack to get back to 7 cards after being hit by several penalties, but the actual card values aren't important. They're only used when the player rejoins, so that's the only place that would need changing (to draw new cards instead of just using what was saved).

dgw commented 5 years ago

Was looking through issues in Jenni (part of Sopel's lineage) and found possible inspiration for a patch addressing this issue in myano/jenni#237