query to bot
This commit is contained in:
parent
72bd49f825
commit
f701b8d633
|
@ -59,12 +59,18 @@ switch ($_POST['act']){
|
||||||
if(!isset($_SESSION['currentPlayer'])){
|
if(!isset($_SESSION['currentPlayer'])){
|
||||||
$_SESSION['currentPlayer']=1;
|
$_SESSION['currentPlayer']=1;
|
||||||
$you="X";
|
$you="X";
|
||||||
|
$opponentName=$_SESSION['bot2']['name'];
|
||||||
|
$botUrl=$_SESSION['bot1']['url'];
|
||||||
}else{
|
}else{
|
||||||
if($_SESSION['currentPlayer']==1){
|
if($_SESSION['currentPlayer']==1){
|
||||||
$_SESSION['currentPlayer']=2;
|
$_SESSION['currentPlayer']=2;
|
||||||
$you="O";
|
$you="O";
|
||||||
|
$opponentName=$_SESSION['bot1']['name'];
|
||||||
|
$botUrl=$_SESSION['bot2']['url'];
|
||||||
}else{
|
}else{
|
||||||
$_SESSION['currentPlayer']=1;
|
$_SESSION['currentPlayer']=1;
|
||||||
|
$opponentName=$_SESSION['bot2']['name'];
|
||||||
|
$botUrl=$_SESSION['bot1']['url'];
|
||||||
$you="X";
|
$you="X";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -73,14 +79,14 @@ switch ($_POST['act']){
|
||||||
$postDatas=array(
|
$postDatas=array(
|
||||||
'game' => 'connectFour',
|
'game' => 'connectFour',
|
||||||
'match_id' => $_SESSION['matchId']."-".$_SESSION['currentPlayer'],
|
'match_id' => $_SESSION['matchId']."-".$_SESSION['currentPlayer'],
|
||||||
//'opponent' => $opponentName,
|
'opponent' => $opponentName,
|
||||||
'you' => $you,
|
'you' => $you,
|
||||||
'grid' => json_encode( $_SESSION['map'])
|
'grid' => json_encode( $_SESSION['map'])
|
||||||
|
|
||||||
);
|
);
|
||||||
//debug
|
//send query
|
||||||
print_r($postDatas);
|
$anwserPlayer=get_IA_Response($botUrl,$postDatas);
|
||||||
print_r($_SESSION['bot1']);
|
echo "player ".$_SESSION['currentPlayer']." répond ".$anwserPlayer;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user