Thanks for any advice, suggestions, help!
My state 'assignGuestRoom' works well repeately before "playTurn" state runs
BGA requestSQL logs - transition 'admitGuest' to 'assignGuestRoom' works correctly just after gameSetup and before state "playerTurn"- note only 1 after jump to nextState1
After "playerTurn" state has run, active player states no longer work.
BGA requestSQL logs - after state "playerTurn" transition 'admitGuest' to 'assignGuestRoom' never happens - the SQL logs shows 3 'after jump to nextState1' - giving me state 'playerTurn' instead
BGA requestSQL logs going directly from state "endRound" to an activePlayer State "payAccomplice" causes error " "Impossible to change active player during activeplayer type state". change active player code is in state endRound method - state 'payAccomplice' has no associated code so no activeplayer change should happen, but the log shows activeNextPlayer happens here
Here are my states
Here is my code game.php code
I am grateful for any help! Thanks!
My state 'assignGuestRoom' works well repeately before "playTurn" state runs
BGA requestSQL logs - transition 'admitGuest' to 'assignGuestRoom' works correctly just after gameSetup and before state "playerTurn"- note only 1 after jump to nextState1
Code: Select all
13/05 01:11:58 [info] [T378668] [50.92.223.190] [2323322/developGames1] nextState with action: 'admitGuest'1
13/05 01:11:58 [info] [T378668] [50.92.223.190] [2323322/developGames1] jump to state 31
13/05 01:11:58 [info] [T378668] [50.92.223.190] [2323322/developGames1] New game state: 'admitGuest'1
13/05 01:11:58 [info] [T378668] [50.92.223.190] [2323322/developGames1] nextState with action: 'assignGuestRoom'1
13/05 01:11:58 [info] [T378668] [50.92.223.190] [2323322/developGames1] jump to state 21
13/05 01:11:58 [info] [T378668] [50.92.223.190] [2323322/developGames1] New game state: 'assignGuestRoom'1
13/05 01:11:58 [info] [T378668] [50.92.223.190] [2323322/developGames1] after jump to nextState1
13/05 01:11:58 [info] [T378668] [50.92.223.190] [2323322/developGames1] checkZombieTurn1
13/05 01:11:58 [info] [T378668] [50.92.223.190] [2323322/developGames1] after jump to nextState1
13/05 01:11:58 [info] [T378668] [50.92.223.190] [2323322/developGames1] Sending notifications1
BGA requestSQL logs - after state "playerTurn" transition 'admitGuest' to 'assignGuestRoom' never happens - the SQL logs shows 3 'after jump to nextState1' - giving me state 'playerTurn' instead
Code: Select all
13/05 01:08:43 [info] [T376668] [50.92.223.190] [2323322/developGames1] nextState with action: 'endRound'1
13/05 01:08:43 [info] [T376668] [50.92.223.190] [2323322/developGames1] jump to state 121
13/05 01:08:43 [info] [T376668] [50.92.223.190] [2323322/developGames1] New game state: 'endRound'1
13/05 01:08:43 [info] [T376668] [50.92.223.190] [2323322/developGames1] nextState with action: 'admitGuest'1
13/05 01:08:43 [info] [T376668] [50.92.223.190] [2323322/developGames1] jump to state 31
13/05 01:08:43 [info] [T376668] [50.92.223.190] [2323322/developGames1] New game state: 'admitGuest'1
13/05 01:08:43 [info] [T376668] [50.92.223.190] [2323322/developGames1] nextState with action: 'assignGuestRoom'1
13/05 01:08:43 [info] [T376668] [50.92.223.190] [2323322/developGames1] jump to state 21
13/05 01:08:43 [info] [T376668] [50.92.223.190] [2323322/developGames1] New game state: 'assignGuestRoom'1
13/05 01:08:43 [info] [T376668] [50.92.223.190] [2323322/developGames1] after jump to nextState1
13/05 01:08:43 [info] [T376668] [50.92.223.190] [2323322/developGames1] after jump to nextState1
13/05 01:08:43 [info] [T376668] [50.92.223.190] [2323322/developGames1] after jump to nextState1
13/05 01:08:43 [info] [T376668] [50.92.223.190] [2323322/developGames1] nextState with action: 'playerTurn'1
13/05 01:08:43 [info] [T376668] [50.92.223.190] [2323322/developGames1] DB rollback: action cancelled1
13/05 01:08:43 [error] [T376668] [50.92.223.190] [2323322/developGames1] Unexpected exception: This transition (playerTurn) is impossible at this state (2)#
#0 /var/tournoi/release/games/bi/999999-9999/bi.game.php(560): Gamestate->nextState()#
#1 /var/tournoi/release/tournoi-220510-1000-gs/www/game/module/table/gamestate.game.php(502): BI->stNextPlayer()#
#2 /var/tournoi/release/tournoi-220510-1000-gs/www/game/module/table/gamestate.game.php(398): Gamestate->jumpToState()#
#3 /var/tournoi/release/games/bi/999999-9999/modules/traveler.php(178): Gamestate->nextState()#
#4 /var/tournoi/release/games/bi/999999-9999/bi.game.php(462): BI->nextGameStateFromPlayerTurnCheckAnnexArray()#
BGA requestSQL logs going directly from state "endRound" to an activePlayer State "payAccomplice" causes error " "Impossible to change active player during activeplayer type state". change active player code is in state endRound method - state 'payAccomplice' has no associated code so no activeplayer change should happen, but the log shows activeNextPlayer happens here
Code: Select all
18/05 23:31:04 [info] [T380840] [50.92.220.52] [2323321/developGames0] nextState with action: 'endRound'1
18/05 23:31:04 [info] [T380840] [50.92.220.52] [2323321/developGames0] jump to state 121
18/05 23:31:04 [info] [T380840] [50.92.220.52] [2323321/developGames0] New game state: 'endRound'1
18/05 23:31:04 [info] [T380840] [50.92.220.52] [2323321/developGames0] nextState with action: 'payAccomplice'1
18/05 23:31:04 [info] [T380840] [50.92.220.52] [2323321/developGames0] jump to state 131
FROM player 1
18/05 23:31:04 [info] [T380840] [50.92.220.52] [2323321/developGames0] New game state: 'payAccomplice'1
WHERE player_id IN ('2323322') 1
18/05 23:31:04 [info] [T380840] [50.92.220.52] [2323321/developGames0] after jump to nextState1
18/05 23:31:04 [info] [T380840] [50.92.220.52] [2323321/developGames0] activeNextPlayer1
18/05 23:31:04 [info] [T380840] [50.92.220.52] [2323321/developGames0] DB rollback: action cancelled1
18/05 23:31:04 [error] [T380840] [50.92.220.52] [2323321/developGames0] Unexpected exception: Impossible to change active player during activeplayer type state#
#0 /var/tournoi/release/tournoi-220513-1000-gs/www/game/module/table/table.game.php(1291): Gamestate->changeActivePlayer()#
#1 /var/tournoi/release/games/bi/999999-9999/bi.game.php(583): Table->activeNextPlayer()#
#2 /var/tournoi/release/tournoi-220513-1000-gs/www/game/module/table/gamestate.game.php(502): BI->stPayAccomplice()#
#3 /var/tournoi/release/tournoi-220513-1000-gs/www/game/module/table/gamestate.game.php(398): Gamestate->jumpToState()#
#4 /var/tournoi/release/games/bi/999999-9999/bi.game.php(569): Gamestate->nextState()#
#5 /var/tournoi/release/tournoi-220513-1000-gs/www/game/module/table/gamestate.game.php(502): BI->stNextPlayer()#
#6 /var/tournoi/release/tournoi-220513-1000-gs/www/game/module/table/gamestate.game.php(398): Gamestate->jumpToState()#
#7 /var/tournoi/release/games/bi/999999-9999/modules/traveler.php(141): Gamestate->nextState()#
#8 /var/tournoi/release/games/bi/999999-9999/bi.game.php(473): BI->nextGameStateFromPlayerTurnCheckAnnexArray()#
#9 /var/tournoi/release/games/bi/999999-9999/bi.action.php(55): BI->playerAction()#
Here are my states
Code: Select all
$machinestates = array(
1 => array(
"name" => "gameSetup",
"description" => "",
"type" => "manager",
"action" => "stGameSetup",
"transitions" => array( "" => 2 )
),
2 => array(
"name" => "assignGuestRoom",
"description" => clienttranslate('${actplayer} must place guest in room'),
"descriptionmyturn" => clienttranslate('${you} must place guest in room'),
"type" => "activeplayer",
"possibleactions" => array( "admitGuest" ),
"transitions" => array( "admitGuest" => 3 )
),
3 => array(
"name" => "admitGuest",
"description" => '',
"type" => "game",
"action" => "stAdmitGuest",
"updateGameProgression" => true,
"transitions" => array( "assignGuestRoom" => 2, "playerTurn" => 4 )
),
4 => array(
"name" => "playerTurn",
"description" => clienttranslate('${actplayer} select guest then hand payment then choose action'),
"descriptionmyturn" => clienttranslate('${you} select guest then hand payment then choose action'),
"type" => "activeplayer",
"possibleactions" => array( "bribed", "killed", "built","burried", "pass" ),
"transitions" => array( "nextPlayer" => 5 )
),
5 => array(
"name" => "nextPlayer",
"description" => '',
"type" => "game",
"action" => "stNextPlayer",
"updateGameProgression" => true,
"transitions" => array( "playerTurn" => 4,"endRound" => 12 )
),
12 => array(
"name" => "endRound",
"description" => '',
"type" => "game",
"action" => "stPayAccomplice",
"updateGameProgression" => true,
"transitions" => array( "admitGuest" => 3, "payAccomplice" => 13, "gameEnd" => 99 )
),
13 => array(
"name" => "payAccomplice",
"description" => clienttranslate('${actplayer} must select accomplice to remove'),
"descriptionmyturn" => clienttranslate('${you} must select accomplice to remove'),
"type" => "activeplayer",
"possibleactions" => array( "remove" ),
"transitions" => array( "endRound" => 12 )
),
99 => array(
"name" => "gameEnd",
"description" => clienttranslate("End of game"),
"type" => "manager",
"action" => "stGameEnd",
"args" => "argGameEnd"
)
);
Here is my code game.php code
Code: Select all
function admitGuest( $info ) {
$this->gamestate->nextState( 'admitGuest' );
}
function stAdmitGuest() {
$traveller = self::incGameStateValue( 'traveller_day_count', 1 );
$num_players = self::getPlayersNumber();
$num_travellers = ( $num_players < 4 ) ? $num_players + 3 : $num_players + 4;
if ( $traveller < $num_travellers ) {
$this->gamestate->nextState( 'assignGuestRoom' );
} else {
$this->gamestate->nextState( 'playerTurn' );
}
}
function stNextPlayer() { // triggered after state "playerTurn"
$this->activeNextPlayer();
if ( $action_round > 1 ) {
$this->gamestate->nextState( 'endRound' );
}
$this->gamestate->nextState( 'playerTurn' );
}
function stPayAccomplice() { // method for endRound state
//some code here...
while ( $starting_player_pay_status == 0 ) {
//some code here
if ( $starting_player_id == $player_id ) self::setGameStateInitialValue('start_player_paid', 1 );
$starting_player_pay_status = self::getGameStateValue( 'start_player_paid');
if ( $wages > $payment[0] ) $this->gamestate->nextState( 'payAccomplice' );
}
if ( $starting_player_pay_status != 0 ) {
$this->gamestate->changeActivePlayer( $starting_player_id );
$this->gamestate->nextState( 'admitGuest' );
}
}
I am grateful for any help! Thanks!