From 029a304ab84dab758ed79638b398f76764180e52 Mon Sep 17 00:00:00 2001 From: gnieark Date: Sun, 19 Jun 2016 23:58:15 +0200 Subject: [PATCH] . --- src/arenas/Battleship/act.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/arenas/Battleship/act.php b/src/arenas/Battleship/act.php index 9f52eea..0b38987 100644 --- a/src/arenas/Battleship/act.php +++ b/src/arenas/Battleship/act.php @@ -277,7 +277,8 @@ switch ($_POST['act']){ 'his_strikes' => $_SESSION['strikes'][$opponent] ) ); - $anwserPlayerJson=get_IA_Response($currentBot['url'],$botParamsToSend); + $anwserPlayer=get_IA_Response($currentBot['url'],$botParamsToSend); + $anwserPlayerJson=$anwserPlayer['responseArr']; if($fullLogs){ $fullLogs='Arena send to '.$currentBot['name'].''.htmlentities($anwserPlayerJson['messageSend']).'
HTTP status: '.htmlentities($anwserPlayerJson['httpStatus']).'
@@ -287,14 +288,14 @@ switch ($_POST['act']){ } - if(!preg_match('/^[0-9]+,[0-9]+$/',$anwserPlayerJson['responseArr']['play'])){ + if(!preg_match('/^[0-9]+,[0-9]+$/',$anwserPlayerJson['play'])){ echo json_encode(array( 'target' => '', 'log' => $fullLogs.$currentBot['name']." a fait une réponse non conforme, il perd.")); save_battle('Battleship',$_SESSION['bot1']['name'],$_SESSION['bot2']['name'],$opponent); die; } - list($x,$y)=explode(",",$anwserPlayerJson['responseArr']['play']); + list($x,$y)=explode(",",$anwserPlayerJson['play']); //check if shot is under map's limits if(($x >= $_SESSION['width']) OR ($y >= $_SESSION['height'])){