Error when using self::checkAction()
Posted: 20 August 2015, 15:50
Hi.
I have this code :
public function chooseStones($choice)
{
self::checkAction("chooseStones", true);
[…]
}
Instead of throwing an exception message like "cette action est impossible à ce moment du jeu" (french), it throws this :
I also don't understand something else.
The JS console tells me this : and the game tells me :
Any idea why it keeps telling me this move is not authorized ?
Is there any way to show the current state with PHP ?
I have this code :
public function chooseStones($choice)
{
self::checkAction("chooseStones", true);
[…]
}
Instead of throwing an exception message like "cette action est impossible à ce moment du jeu" (french), it throws this :
Any idea ?Server syntax error: Warning: Invalid argument supplied for foreach() in /var/tournoi/release/tournoi-150617-1039-gs/www/game/module/table/gamestate.game.php on line 152 {"status":"0","error":"Cette action est impossible \u00e0 ce moment du jeu","expected":1,"code":900,"stack":"#0 \/var\/tournoi\/release\/tournoi-150617-1039-gs\/www\/game\/module\/table\/table.game.php(582): Gamestate->checkPlayerAction('chooseStones', true)\n#1 \/var\/tournoi\/release\/games\/fanorona\/999999-9999\/fanorona.game.php(465): Table->checkAction('chooseStones', true)\n#2 \/var\/tournoi\/release\/games\/fanorona\/999999-9999\/fanorona.action.php(70): Fanorona->chooseStones('front')\n#3 \/var\/tournoi\/release\/tournoi-150617-1039-gs\/www\/include\/webActionCore.inc.php(126): action_fanorona->chooseStones()\n#4 \/var\/tournoi\/release\/tournoi-150617-1039-gs\/www\/index.php(126): launchWebAction('fanorona', 'fanorona', 'chooseStones', false, false, NULL, true, false)\n#5 {main}"}
I also don't understand something else.
The JS console tells me this :
When I click on my element during this state, it triggers this :Entering state: chooseStones
Code: Select all
if(!this.checkAction('chooseStones')) { return ; }But it's during my chooseStones state, which looks like it :This move is not authorized now
Code: Select all
5 => array(
"name" => "chooseStones",
"description" => clienttranslate('${actplayer} must choose which stone(s) to capture'),
"descriptionmyturn" => clienttranslate('${you} must choose which stone(s) to capture'),
"type" => "activeplayer",
"possibleactions" => "chooseStones",
"transitions" => array("captureStones" => 6)
),Is there any way to show the current state with PHP ?