This commit is contained in:
Gnieark 2016-06-20 20:33:45 +02:00
parent 98b29495b8
commit 642ae29284

View File

@ -298,7 +298,7 @@ switch ($_POST['act']){
OR (!preg_match('/^[0-9]+,[0-9]+$/',$anwserPlayerJson['play']))){ OR (!preg_match('/^[0-9]+,[0-9]+$/',$anwserPlayerJson['play']))){
echo json_encode(array( echo json_encode(array(
'target' => '', 'target' => '',
'log' => $fullLogs.$currentBot['name']." a fait une réponse non conforme, il perd.")); 'logs' => $fullLogs.$currentBot['name']." a fait une réponse non conforme, il perd."));
save_battle('Battleship',$_SESSION['bot1']['name'],$_SESSION['bot2']['name'],$opponent); save_battle('Battleship',$_SESSION['bot1']['name'],$_SESSION['bot2']['name'],$opponent);
die; die;
} }
@ -308,7 +308,7 @@ switch ($_POST['act']){
if(($x >= $_SESSION['width']) OR ($y >= $_SESSION['height'])){ if(($x >= $_SESSION['width']) OR ($y >= $_SESSION['height'])){
echo json_encode(array( echo json_encode(array(
'target' => '', 'target' => '',
'log' => $fullLogs.$currentBot['name']." a fait un tir en dehors des limites de la carte. ".$x.",".$y." C'est interdit par les conventions de Geneve. Il perd" 'logs' => $fullLogs.$currentBot['name']." a fait un tir en dehors des limites de la carte. ".$x.",".$y." C'est interdit par les conventions de Geneve. Il perd"
)); ));
save_battle('Battleship',$_SESSION['bot1']['name'],$_SESSION['bot2']['name'],$opponent); save_battle('Battleship',$_SESSION['bot1']['name'],$_SESSION['bot2']['name'],$opponent);
die; die;
@ -361,16 +361,16 @@ switch ($_POST['act']){
'result' => $result 'result' => $result
); );
//send message for the arena's ajax web page //send message for the arena's ajax web page
echo json_encode(array( echo json_encode(array(
'opponent'=> $opponent, 'opponent'=> $opponent,
'target' => $x.",".$y, 'target' => $x.",".$y,
'log' => $fullLogs.$currentBot['name']." tire en ".$x.",".$y." ".$result, 'logs' => $fullLogs.$currentBot['name']." tire en ".$x.",".$y." ".$result,
'continue' => $continue 'continue' => $continue
)); ));
die; die;
break; break;
default: default:
break; break;
} }