Potential Exploit -- Re-Iding the deck
Posted: 10 June 2020, 15:22
In 2 player cribbage the player gets six cards later in the hand then the non-dealer cuts a card
Right now in my game the cardIds for the player hand is expose
<div id="myhand_item_10" class="stockitem "
In one game lets say card.id = 10 is the 5 of Hearts
Now when the person goes to cut the deck I display all cards with there card Id but a card back showing
...
<div id="fullDeck_item_9" class="stockitem " style="top: 0px; left: 96px; width: 72px; height: 96px; z-index: 10; ..."></div>
<div id="fullDeck_item_11" class="stockitem " style="top: 0px; left: 108px; width: 72px; height: 96px; z-index: 11; ..."></div>
....
Now in the game database cad id 9 is 9 of diamonds and card id 11 is the 9 of hearts
IF a player was to record all the ids in there hand (and even the ids of cards played by there opponent) then over the course of a game the player can cut the correct card that they want.
I verified this using the next hand and looking for fullDeck_item_10 and cut the 5 of hearts
My question is
Can I recreate the card table every hand?
What is the computing cost of doing so?
Is it as simple as re-running these lines?
Right now in my game the cardIds for the player hand is expose
<div id="myhand_item_10" class="stockitem "
In one game lets say card.id = 10 is the 5 of Hearts
Now when the person goes to cut the deck I display all cards with there card Id but a card back showing
...
<div id="fullDeck_item_9" class="stockitem " style="top: 0px; left: 96px; width: 72px; height: 96px; z-index: 10; ..."></div>
<div id="fullDeck_item_11" class="stockitem " style="top: 0px; left: 108px; width: 72px; height: 96px; z-index: 11; ..."></div>
....
Now in the game database cad id 9 is 9 of diamonds and card id 11 is the 9 of hearts
IF a player was to record all the ids in there hand (and even the ids of cards played by there opponent) then over the course of a game the player can cut the correct card that they want.
I verified this using the next hand and looking for fullDeck_item_10 and cut the 5 of hearts
My question is
Can I recreate the card table every hand?
What is the computing cost of doing so?
Is it as simple as re-running these lines?
Code: Select all
$this->cards = self::getNew( "module.common.deck" );
$this->cards->init( "card" );
$this->cards->createCards( $cards, 'deck');