This commit is contained in:
Gnieark 2016-06-27 14:35:49 +02:00
commit 037a3260ce
2 changed files with 11 additions and 3 deletions

View File

@ -1,2 +1,2 @@
# IAS fot Bots arena or Bollosseum
# IAS for BotsArena or Bollosseum
They ar hosted at https://ias.tinad.fr/

View File

@ -24,6 +24,8 @@ mysqli_set_charset($lnMySQL, 'utf8');
//purge old games
mysqli_query($lnMySQL,"DELETE FROM battleship_current WHERE time < (NOW() - INTERVAL 10 MINUTE)");
$trace = "";
function hash_map($map,$me,$opponent){
$hashMap = "";
foreach($map as $line){
@ -57,7 +59,7 @@ function remenber_previous_lap_is_a_bullshit(){
}
function play($map,$colToPlay,$me,$opponent,$gameid,$player_index){
global $lnMySQL;
global $lnMySQL,$trace;
//save the lap on the database and then send the play response
mysqli_query($lnMySQL,
@ -70,7 +72,11 @@ function play($map,$colToPlay,$me,$opponent,$gameid,$player_index){
map='".hash_map($map,$me,$opponent)."',
play_at='".$colToPlay."';");
<<<<<<< HEAD
echo '{"play":'.$colToPlay.'}';
=======
echo '{"play":'.$colToPlay.',"trace":"'.$trace.'"}';
>>>>>>> 6274fd69c6243df749a1975580ece25a3f80582f
die;
}
@ -381,6 +387,8 @@ switch($params['action']){
$learnedCells[] = $r[0];
}
$trace.="|learnedCells:".implode(","$learnedCells);
$colAvailable=array();
for($i=0;$i<7;$i++){
if((($params['board'][5][$i] == "+") OR ($params['board'][5][$i] == "-"))