Before posting this I looked through the forum and the bug list but couldn't find anything related. I'm sorry if this is a known issue.
Bug report: https://boardgamearena.com/bug?id=78674
The development team has done a great job of hiding the player's starting cards. However, for some reason the game client knows the entire content of the card deck from the very beginning of the match. This data is passed to `gameui.completesetup(...)` as an argument (location: the page source) and is accessible through `gameui.gamedatas.deck`.
Here's a script that uses this information, which we definitely shouldn't have, and prints the player's hand and the top card of the deck.
Now I know my cards are (4 blue, 2 white, 5 green, ?) without needing any clues. "?" means this card is one of my starting cards, so it's not in the `deck` object.
Interestingly enough, I couldn't find any usage of this object in the code. If that's true, I'm guessing it's a pretty easy fix.
Bug report: https://boardgamearena.com/bug?id=78674
The development team has done a great job of hiding the player's starting cards. However, for some reason the game client knows the entire content of the card deck from the very beginning of the match. This data is passed to `gameui.completesetup(...)` as an argument (location: the page source) and is accessible through `gameui.gamedatas.deck`.
Here's a script that uses this information, which we definitely shouldn't have, and prints the player's hand and the top card of the deck.
Code: Select all
(function() {
function printPlayerHand() {
const cardsDiv = document.getElementById(`playertablecard_${gameui.player_id}`);
const cards = [...cardsDiv.getElementsByClassName("card")].reverse();
const message = cards.map(card => {
const cardId = card.id.split("_").at(-1);
const info = gameui.gamedatas.deck[cardId];
return info ? `${info.type_arg} ${gameui.colorNames[info.type]}` : "?";
}).join(", ");
console.log(`Your hand: ${message}`);
}
function printNextCard() {
const cardsLeft = Number(document.getElementById("deck_pile_item_1").textContent);
const info = gameui.gamedatas.deck[String(cardsLeft * 2)];
console.log(`The next card in the deck: ${info.type_arg} ${gameui.colorNames[info.type]}`)
}
printPlayerHand();
printNextCard();
})();
Now I know my cards are (4 blue, 2 white, 5 green, ?) without needing any clues. "?" means this card is one of my starting cards, so it's not in the `deck` object.
Interestingly enough, I couldn't find any usage of this object in the code. If that's true, I'm guessing it's a pretty easy fix.