Problem with debugging a bug report (turn the tide)

Game development with Board Game Arena Studio
Post Reply
User avatar
Volker78
Posts: 66
Joined: 29 April 2020, 21:37

Problem with debugging a bug report (turn the tide)

Post by Volker78 »

I have a bug report here:

https://boardgamearena.com/bug?id=22340

After analyzing the game log, I decided, to load the game state into a studio-DB-Table.

That worked, but the state was in endgame state, but I need the DB-state of move 74, else I cannot debug this report.

What happens after this move:

Somehow the following function could not have set all players multiactive, although it should have:

Code: Select all

 public function stSelectCardsInit()
    {
        $ids = $this->getObjectListFromDB("SELECT player_id FROM player WHERE rings_left >= 0", true);
    
        $this->gamestate->setPlayersMultiactive($ids, "", true);
    }
it should have, because, this was the last code in the previous state:

Code: Select all

$players = $this->loadPlayersBasicInfos();
...
 $turn_order = $this->getNextPlayerTable();
                foreach ($players as $player_id => $player) {
                    $next_player_id = $turn_order[$player_id];
                    $rings_next = $rings[$player_id]["rings"];
                    $this->DbQuery("UPDATE player SET rings = '$rings_next', rings_left = '$rings_next' WHERE player_id = '$next_player_id'");
                    $this->cards->moveAllCardsInLocation('discard', 'hand', $player_id, $next_player_id);
                }
                $this->gamestate->nextState('selectCards');
and $rings[$player_id] is per definition always >= 0 for all players

It should really be possible to load a game in a required move-state somehow.

Is it possible to set the second argument of the following function to an illegal value like "", to force the game to halt in an error state, so I can debug it afterwards?

$this->gamestate->setPlayerNonMultiactive($player_id, "");

I would also be happy, if someone else could have a look at the code (read access).
User avatar
Victoria_La
Posts: 665
Joined: 28 December 2015, 20:55

Re: Problem with debugging a bug report (turn the tide)

Post by Victoria_La »

You can edit the database directly if it helps... Also add more logging to this function, so next time you can look at production logs
Post Reply

Return to “Developers”