From 3ba9f979a3c80d4a277e4fd32fd9ea8296eed4cb Mon Sep 17 00:00:00 2001 From: Gnieark Date: Mon, 6 Jun 2016 11:46:28 +0200 Subject: [PATCH 1/6] . --- src/arenas/tictactoe/act.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/arenas/tictactoe/act.php b/src/arenas/tictactoe/act.php index a520ad7..bd6c820 100644 --- a/src/arenas/tictactoe/act.php +++ b/src/arenas/tictactoe/act.php @@ -68,7 +68,7 @@ switch ($_POST['act']){ 'game' => 'tictactoe', 'players' => 2, 'board' => $map, - 'you' => $playerCHAR, + 'you' => $playerCHAR, 'player-index' =>$playerIndex ); @@ -126,7 +126,7 @@ switch ($_POST['act']){ $playerPlayingNow=1; } }else{ - echo "

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

"; + echo "

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

".json_encode($playerResponse)."

"; break; } From a3fc3e649b22f4b4dfe1e051ec74efb6c5b469d7 Mon Sep 17 00:00:00 2001 From: Gnieark Date: Mon, 6 Jun 2016 11:53:05 +0200 Subject: [PATCH 2/6] . --- src/arenas/tictactoe/functions.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/arenas/tictactoe/functions.php b/src/arenas/tictactoe/functions.php index 8b713c9..3706983 100644 --- a/src/arenas/tictactoe/functions.php +++ b/src/arenas/tictactoe/functions.php @@ -49,5 +49,6 @@ function get_IA_Response($iaUrl,$postParams){ ); $output= curl_exec($ch); curl_close($ch); + echo $output; return json_decode($output,TRUE); } \ No newline at end of file From 99fab19234ae9ebc074d03a53815d473420dd913 Mon Sep 17 00:00:00 2001 From: Gnieark Date: Mon, 6 Jun 2016 11:54:31 +0200 Subject: [PATCH 3/6] . --- src/arenas/tictactoe/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arenas/tictactoe/functions.php b/src/arenas/tictactoe/functions.php index 3706983..7ebc15c 100644 --- a/src/arenas/tictactoe/functions.php +++ b/src/arenas/tictactoe/functions.php @@ -49,6 +49,6 @@ function get_IA_Response($iaUrl,$postParams){ ); $output= curl_exec($ch); curl_close($ch); - echo $output; + echo $iaUrl." ".$output.'
'; return json_decode($output,TRUE); } \ No newline at end of file From 4c03488d16649dbb9c6c76065c1dfea5bac92b06 Mon Sep 17 00:00:00 2001 From: Gnieark Date: Mon, 6 Jun 2016 12:12:43 +0200 Subject: [PATCH 4/6] . --- src/arenas/tictactoe/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arenas/tictactoe/functions.php b/src/arenas/tictactoe/functions.php index 7ebc15c..9dea832 100644 --- a/src/arenas/tictactoe/functions.php +++ b/src/arenas/tictactoe/functions.php @@ -49,6 +49,6 @@ function get_IA_Response($iaUrl,$postParams){ ); $output= curl_exec($ch); curl_close($ch); - echo $iaUrl." ".$output.'
'; + echo $iaUrl." ".$data_string." ".$output.'
'; return json_decode($output,TRUE); } \ No newline at end of file From 3d26cba5bd5d824574b93b646a4cd2398687577a Mon Sep 17 00:00:00 2001 From: gnieark Date: Mon, 6 Jun 2016 13:12:01 +0200 Subject: [PATCH 5/6] disable ssl verification --- src/arenas/tictactoe/act.php | 6 ++---- src/arenas/tictactoe/functions.php | 6 ++++-- 2 files changed, 6 insertions(+), 6 deletions(-) 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 From 22ecf1f4c8957eb014742a1f50c38c5f60444089 Mon Sep 17 00:00:00 2001 From: gnieark Date: Mon, 6 Jun 2016 13:13:07 +0200 Subject: [PATCH 6/6] disable ssl verification --- src/arenas/tictactoe/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arenas/tictactoe/functions.php b/src/arenas/tictactoe/functions.php index 6c1fc41..c1ebddd 100644 --- a/src/arenas/tictactoe/functions.php +++ b/src/arenas/tictactoe/functions.php @@ -42,7 +42,7 @@ function get_IA_Response($iaUrl,$postParams){ $ch = curl_init($iaUrl); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array(