Hi to all developers,
I am following the reversi tutorial steps, currently in "Setup the initial game position" section, and I'm facing this error :
Here is my php code (totally copied from the tutorial without any modification) :
(line 89 as mentioned in the error log is the one starting with "list( $blackplayer_id)
Where did I miss something ?
Thank you
EDIT : I only forgot to clic the "+" button to add a second player ! Now the game starts.
But it remains one problem : All four tokens are white !
I am following the reversi tutorial steps, currently in "Setup the initial game position" section, and I'm facing this error :
Code: Select all
Unexpected error: Wrong formatted data from BGA gameserver 1 (method: createGame): JSON_ERROR_SYNTAX
Notice: Undefined offset: 1 in /var/tournoi/release/games/reversijhtuto/999999-9999/reversijhtuto.game.php on line 89
{"status":1,"data":true}Here is my php code (totally copied from the tutorial without any modification) :
Code: Select all
// Init the board
$sql = "INSERT INTO board (board_x,board_y,board_player) VALUES ";
$sql_values = array();
list( $blackplayer_id, $whiteplayer_id ) = array_keys( $players );
for( $x=1; $x<=8; $x++ )
{
for( $y=1; $y<=8; $y++ )
{
$token_value = "NULL";
if( ($x==4 && $y==4) || ($x==5 && $y==5) ) // Initial positions of white player
$token_value = "'$whiteplayer_id'";
else if( ($x==4 && $y==5) || ($x==5 && $y==4) ) // Initial positions of black player
$token_value = "'$blackplayer_id'";
$sql_values[] = "('$x','$y',$token_value)";
}
}
$sql .= implode( $sql_values, ',' );
self::DbQuery( $sql );
// Active first player
self::activeNextPlayer(); Where did I miss something ?
Thank you
EDIT : I only forgot to clic the "+" button to add a second player ! Now the game starts.
But it remains one problem : All four tokens are white !