diff --git a/src/arenas/tictactoe/act.php b/src/arenas/tictactoe/act.php index bd6c820..b0d0f26 100644 --- a/src/arenas/tictactoe/act.php +++ b/src/arenas/tictactoe/act.php @@ -36,9 +36,7 @@ switch ($_POST['act']){ } get_IA_Response($bots[$bot1]['url'],$params[0]); //don't care about result get_IA_Response($bots[$bot2]['url'],$params[1]); //don't care about result - - //"game-id":"gameid","action":"init","game":"tictactoe","players":2,"board":null,"you":null,"player-index":0} - //[0000] body> {"name":"moul-tictactoe","play":null,"error":null} + $playerPlayingNow=1; @@ -126,7 +124,7 @@ switch ($_POST['act']){ $playerPlayingNow=1; } }else{ - echo "

".$playerName." a fait une réponse non conforme. Il perd

".json_encode($playerResponse)."

"; + echo "

".$playerName." a fait une réponse non conforme. Il perd.

"; break; } diff --git a/src/arenas/tictactoe/functions.php b/src/arenas/tictactoe/functions.php index 9dea832..6c1fc41 100644 --- a/src/arenas/tictactoe/functions.php +++ b/src/arenas/tictactoe/functions.php @@ -40,7 +40,9 @@ function get_IA_Response($iaUrl,$postParams){ $data_string = json_encode($postParams); $ch = curl_init($iaUrl); - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( @@ -49,6 +51,6 @@ function get_IA_Response($iaUrl,$postParams){ ); $output= curl_exec($ch); curl_close($ch); - echo $iaUrl." ".$data_string." ".$output.'
'; + //echo $iaUrl." ".$data_string." ".$output.'
'; return json_decode($output,TRUE); } \ No newline at end of file