.
This commit is contained in:
commit
037a3260ce
|
@ -1,2 +1,2 @@
|
||||||
# IAS fot Bots arena or Bollosseum
|
# IAS for BotsArena or Bollosseum
|
||||||
They ar hosted at https://ias.tinad.fr/
|
They ar hosted at https://ias.tinad.fr/
|
||||||
|
|
|
@ -24,6 +24,8 @@ mysqli_set_charset($lnMySQL, 'utf8');
|
||||||
//purge old games
|
//purge old games
|
||||||
mysqli_query($lnMySQL,"DELETE FROM battleship_current WHERE time < (NOW() - INTERVAL 10 MINUTE)");
|
mysqli_query($lnMySQL,"DELETE FROM battleship_current WHERE time < (NOW() - INTERVAL 10 MINUTE)");
|
||||||
|
|
||||||
|
$trace = "";
|
||||||
|
|
||||||
function hash_map($map,$me,$opponent){
|
function hash_map($map,$me,$opponent){
|
||||||
$hashMap = "";
|
$hashMap = "";
|
||||||
foreach($map as $line){
|
foreach($map as $line){
|
||||||
|
@ -57,7 +59,7 @@ function remenber_previous_lap_is_a_bullshit(){
|
||||||
}
|
}
|
||||||
|
|
||||||
function play($map,$colToPlay,$me,$opponent,$gameid,$player_index){
|
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
|
//save the lap on the database and then send the play response
|
||||||
mysqli_query($lnMySQL,
|
mysqli_query($lnMySQL,
|
||||||
|
@ -70,7 +72,11 @@ function play($map,$colToPlay,$me,$opponent,$gameid,$player_index){
|
||||||
map='".hash_map($map,$me,$opponent)."',
|
map='".hash_map($map,$me,$opponent)."',
|
||||||
play_at='".$colToPlay."';");
|
play_at='".$colToPlay."';");
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
echo '{"play":'.$colToPlay.'}';
|
echo '{"play":'.$colToPlay.'}';
|
||||||
|
=======
|
||||||
|
echo '{"play":'.$colToPlay.',"trace":"'.$trace.'"}';
|
||||||
|
>>>>>>> 6274fd69c6243df749a1975580ece25a3f80582f
|
||||||
die;
|
die;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -380,7 +386,9 @@ switch($params['action']){
|
||||||
while($r = mysqli_fetch_row($rs)){
|
while($r = mysqli_fetch_row($rs)){
|
||||||
$learnedCells[] = $r[0];
|
$learnedCells[] = $r[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$trace.="|learnedCells:".implode(","$learnedCells);
|
||||||
|
|
||||||
$colAvailable=array();
|
$colAvailable=array();
|
||||||
for($i=0;$i<7;$i++){
|
for($i=0;$i<7;$i++){
|
||||||
if((($params['board'][5][$i] == "+") OR ($params['board'][5][$i] == "-"))
|
if((($params['board'][5][$i] == "+") OR ($params['board'][5][$i] == "-"))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user