Update client side info parsing

This commit is contained in:
Christoph Hagen 2021-12-09 11:11:42 +01:00
parent 289458bfd8
commit 3e85c01809

View File

@ -197,9 +197,9 @@ function setCard(id, card, layer) {
function updateTableInfo(table) {
showTableName(table.name)
// Set own cards
const cardCount = table.player.cards.length
const cardCount = table.cards.length
for (let i = 0; i < cardCount; i += 1) {
const card = table.player.cards[i]
const card = table.cards[i]
setHandCard(i+1, card.card, card.playable)
}
for (let i = cardCount; i < 8; i += 1) {
@ -209,7 +209,7 @@ function updateTableInfo(table) {
// Show player info
console.log(table)
setInfoForPlayer(table.player, "bottom")
if (table.player.selectsGame) {
if (table.playerSelectsGame) {
setActionsForOwnPlayer(table.playableGames)
showAvailableGames([])
} else {
@ -218,7 +218,7 @@ function updateTableInfo(table) {
} else {
showAvailableGames([])
}
setActionsForOwnPlayer(table.player.actions)
setActionsForOwnPlayer(table.actions)
}
if (table.hasOwnProperty("playerLeft")) {
setInfoForPlayer(table.playerLeft, "left")