From 27b04754fd1121fbd8eaeb9c2dc4ed493c2898ec Mon Sep 17 00:00:00 2001 From: gnieark Date: Sun, 12 Jun 2016 18:11:05 +0200 Subject: [PATCH] . --- src/arenas/connectFour/js.js | 2 +- src/functions.php | 36 +++++++++++++++++++++++++----------- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/src/arenas/connectFour/js.js b/src/arenas/connectFour/js.js index 427ab57..d47f5bc 100644 --- a/src/arenas/connectFour/js.js +++ b/src/arenas/connectFour/js.js @@ -47,7 +47,7 @@ function connectFour(bot1,bot2,xd_check, gameId, newGame){ document.getElementById('fightResult').appendChild(table); var divLogs=createElem("div",{"id":"logs"}); document.getElementById('fightResult').appendChild(divLogs); - } + } //send request var xhr = Ajx(); xhr.onreadystatechange = function(){if(xhr.readyState == 4){ diff --git a/src/functions.php b/src/functions.php index 9b2caca..77cc2ac 100644 --- a/src/functions.php +++ b/src/functions.php @@ -280,42 +280,41 @@ function save_battle($game,$bot1,$bot2,$resultat){ } function get_unique_id(){ + //increment the number $fp = fopen(__DIR__.'/../countBattles.txt', 'c+'); flock($fp, LOCK_EX); - $count = (int)fread($fp, filesize(__DIR__.'/../countBattles.txt')); ftruncate($fp, 0); fseek($fp, 0); fwrite($fp, $count + 1); - flock($fp, LOCK_UN); fclose($fp); return $count; } function get_default_aside_content($currentArena){ global $lang; - $asideSectionContent='

infos:

'.$lang['DEV-YOUR-OWN-BOT'].'
'.$lang['DOC_SPECS_LINKS'].'

+ $asideSectionContent = '

infos:

'.$lang['DEV-YOUR-OWN-BOT'].'
'.$lang['DOC_SPECS_LINKS'].'

Scores

'; $podium=ELO_get_podium($currentArena); $count=0; - $asideSectionContent.='