BGA bug? gameSetup state in JavaScript
Posted: 04 July 2020, 18:49
It seems the BGA framework has a race condition bug about game states. Sometimes, the JavaScript UI receives onEnteringState() call for "gameSetup" at the start of the game, but sometimes it does not. Why is the behavior inconsistent?
My states.inc.php file looks something like this:
Usually, the first state we get in the JavaScript UI is "buildOffer".
But here is a production example where "gameSetup" and "powerSetup" were sent to the UI first!
https://boardgamearena.com/archive/repl ... 161;#debug
My states.inc.php file looks something like this:
Code: Select all
ST_BGA_GAME_SETUP => [
'name' => 'gameSetup',
'description' => '',
'type' => 'manager',
'action' => 'stGameSetup',
'transitions' => [
'' => ST_POWERS_SETUP,
],
],
ST_POWERS_SETUP => [
'name' => 'powersSetup',
'description' => '',
'type' => 'game',
'action' => 'stPowersSetup',
'transitions' => [
'placeWorker' => ST_NEXT_PLAYER_PLACE_WORKER,
'offer' => ST_BUILD_OFFER,
'chooseFirstPlayer' => ST_CHOOSE_FIRST_PLAYER
],
],
ST_BUILD_OFFER => [
'name' => 'buildOffer',
'type' => 'activeplayer',
...
But here is a production example where "gameSetup" and "powerSetup" were sent to the UI first!
https://boardgamearena.com/archive/repl ... 161;#debug
Code: Select all
Entering state: gameSetup {id: "1", active_player: "6870632", args: null, reflexion: {…}, updateGameProgression: 0, …}
Leaving state: gameSetup
Entering state: powersSetup {id: 10, active_player: "6870632", args: null, type: "game", reflexion: {…}, …}
Leaving state: powersSetup
Entering state: buildOffer