Merge pull request #83 from gnieark/dev

Dev
This commit is contained in:
Gnieark 2016-06-11 17:54:44 +02:00 committed by GitHub
commit d4686b3ad4
5 changed files with 30 additions and 40 deletions

BIN
html/imgs/Arenes-Nimes.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 550 KiB

View File

@ -1,4 +1,10 @@
<article>
<h2>Cette arène est en cours de maintenance, elle sera de nouveau prête dans les prochains jours</h2>
<p><img style="width: 100%;" src="/imgs/Arenes-Nimes.jpg" alt="travaux sur les arènes de Nimes"/></p>
</article>
<?php <?php
/*
require_once(__DIR__."/functions.php"); require_once(__DIR__."/functions.php");
$bots=get_Bots_Array('Battleship'); $bots=get_Bots_Array('Battleship');
@ -52,4 +58,6 @@ if(!$postParams){
<!-- battleship(bot1,bot2,gridWidth,gridHeight,nbShip1,nbShip2,nbShip3,nbShip4,nbShip5,nbShip6,xd_check) --> <!-- battleship(bot1,bot2,gridWidth,gridHeight,nbShip1,nbShip2,nbShip3,nbShip4,nbShip5,nbShip6,xd_check) -->
<p><label>&nbsp;</label><input type="button" value="<?php echo $lang['FIGHT']; ?>" onclick="battleship(document.getElementById('bot1').value,document.getElementById('bot2').value,getElementById('width').value,getElementById('height').value,getElementById('ship1').value,getElementById('ship2').value,getElementById('ship3').value,getElementById('ship4').value,getElementById('ship5').value,getElementById('ship6').value,'<?php echo xd_check_input(2); ?>');"></p> <p><label>&nbsp;</label><input type="button" value="<?php echo $lang['FIGHT']; ?>" onclick="battleship(document.getElementById('bot1').value,document.getElementById('bot2').value,getElementById('width').value,getElementById('height').value,getElementById('ship1').value,getElementById('ship2').value,getElementById('ship3').value,getElementById('ship4').value,getElementById('ship5').value,getElementById('ship6').value,'<?php echo xd_check_input(2); ?>');"></p>
<div id="fightResult"></div> <div id="fightResult"></div>
</article> </article
*/
?>

View File

@ -1,23 +1,4 @@
<?php <?php
function get_IA_Response($iaUrl,$postParams){
//send params JSON as body
$data_string = json_encode($postParams);
$ch = curl_init($iaUrl);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
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(
'Content-Type: application/json',
'Content-Length: ' . strlen($data_string))
);
$output= curl_exec($ch);
curl_close($ch);
//echo $iaUrl." ".$data_string." ".$output.'<br/>';
return json_decode($output,TRUE);
}
function get_Post_Params($botsCount){ function get_Post_Params($botsCount){
$keysBots=array('bot1','bot2'); $keysBots=array('bot1','bot2');
foreach($keysBots as $botKey){ foreach($keysBots as $botKey){

View File

@ -34,23 +34,3 @@ function get_Bots_Array(){
return $bots; return $bots;
} }
*/ */
function get_IA_Response($iaUrl,$postParams){
//send params JSON as body
$data_string = json_encode($postParams);
$ch = curl_init($iaUrl);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
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(
'Content-Type: application/json',
'Content-Length: ' . strlen($data_string))
);
$output= curl_exec($ch);
curl_close($ch);
//echo $iaUrl." ".$data_string." ".$output.'<br/>';
return json_decode($output,TRUE);
}

View File

@ -331,4 +331,25 @@ function does_arena_exist($string,$arenasArr){
} }
} }
return false; return false;
}
function get_IA_Response($iaUrl,$postParams){
//send params JSON as body
$data_string = json_encode($postParams);
$ch = curl_init($iaUrl);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
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(
'Content-Type: application/json',
'Content-Length: ' . strlen($data_string))
);
$output= curl_exec($ch);
curl_close($ch);
//echo $iaUrl." ".$data_string." ".$output.'<br/>';
return json_decode($output,TRUE);
} }