diff --git a/src/PHPMailer b/src/PHPMailer
index c2bde34..7c8b786 160000
--- a/src/PHPMailer
+++ b/src/PHPMailer
@@ -1 +1 @@
-Subproject commit c2bde34e58caa500b8fb2f7e14fc9765596cdf6d
+Subproject commit 7c8b786228bb9e1561ff60a2d6f7f6ce91be6fee
diff --git a/src/arenas/Battleship/act.php b/src/arenas/Battleship/act.php
index b928e8c..1bb6aa7 100644
--- a/src/arenas/Battleship/act.php
+++ b/src/arenas/Battleship/act.php
@@ -1,4 +1,15 @@
'.htmlentities($tempPlayer['messageSend']).'
+ HTTP status: '.htmlentities($tempPlayer['httpStatus']).'
+ Bot anwser: '.htmlentities($tempPlayer['response']).'
';
+
+ }else{
+ $fullLogs='';
+ }
//vérifier la validité de la réponse
if((isset($_SESSION['map'][5][$anwserPlayer])) && ($_SESSION['map'][5][$anwserPlayer] == "")){
//reponse conforme
@@ -258,7 +266,7 @@ switch ($_POST['act']){
'strikeX' => $strikeX,
'strikeY' => $strikeY,
'strikeSymbol'=> $you,
- 'log' => $you." ".$currentBotName." joue colonne ". $anwserPlayer." et a gagné",
+ 'log' => $fullLogs.$you." ".$currentBotName." joue colonne ". $anwserPlayer." et a gagné",
'cellsWin' => json_encode($cellsWin),
'gameId' => $_SESSION['matchId']
);
@@ -288,7 +296,7 @@ switch ($_POST['act']){
'strikeX' => $strikeX,
'strikeY' => $strikeY,
'strikeSymbol'=> $you,
- 'log' => $you." ".$currentBotName." joue colonne ". $anwserPlayer." match nul",
+ 'log' => $fullLogs.$you." ".$currentBotName." joue colonne ". $anwserPlayer." match nul",
'gameId' => $_SESSION['matchId']
);
@@ -299,7 +307,7 @@ switch ($_POST['act']){
'strikeX' => $strikeX,
'strikeY' => $strikeY,
'strikeSymbol'=> $you,
- 'log' => $you." ".$currentBotName." joue colonne ". $anwserPlayer,
+ 'log' => $fullLogs.$you." ".$currentBotName." joue colonne ". $anwserPlayer,
'gameId' => $_SESSION['matchId']
);
}
@@ -312,10 +320,7 @@ switch ($_POST['act']){
'continue' =>0,
'strikeX' => -1,
'strikeY' => -1,
- 'log' => $you." ".$currentBotName." made a non conform anwser:
- Bots Arena sent:".$tempPlayer['messageSend']."
- ".$currentBotName." HTTP STATUS: ".$tempPlayer['httpStatus']."
- His response: ".htmlentities($tempPlayer['response'])."",
+ 'log' => $fullLogs.$you." ".$currentBotName." made a non conform anwser.",
'gameId' => $_SESSION['matchId']
);
if($_SESSION['currentPlayer']==1){
diff --git a/src/arenas/connectFour/js.js b/src/arenas/connectFour/js.js
index 301df4d..2802f6a 100644
--- a/src/arenas/connectFour/js.js
+++ b/src/arenas/connectFour/js.js
@@ -13,9 +13,12 @@ function Ajx(){
return request;
}
function addLog(message){
+ var divLogs = document.getElementById("logs");
var p=createElem('p',{});
p.innerHTML=message;
- document.getElementById('logs').appendChild(p);
+ divLogs.appendChild(p);
+ divLogs.scrollTop = divLogs.scrollHeight;
+
}
function createElem(type,attributes){
var elem=document.createElement(type);
@@ -57,9 +60,6 @@ function connectFour(bot1,bot2,xd_check, gameId, newGame){
var xhr = Ajx();
xhr.onreadystatechange = function(){if(xhr.readyState == 4){
if(xhr.status == 200) {
- //for test
- // alert(xhr.responseText);
-
try{
var reponse = JSON.parse(xhr.responseText);
}catch(e){
@@ -85,7 +85,6 @@ function connectFour(bot1,bot2,xd_check, gameId, newGame){
}
-
//if game isn't finished, continue
if(reponse['continue'] == 1){
connectFour(bot1,bot2,xd_check,reponse['gameId'], false);
@@ -108,5 +107,5 @@ function connectFour(bot1,bot2,xd_check, gameId, newGame){
}else{
var act='fight';
}
- xhr.send('act=' + act + '&bot1=' + bot1 + '&bot2=' + bot2 + '&xd_check=' + xd_check + '&gameId=' + gameId);
+ xhr.send('act=' + act + '&bot1=' + bot1 + '&bot2=' + bot2 + '&xd_check=' + xd_check + '&gameId=' + gameId + '&fullLogs=' + document.getElementById("fullLogs").checked);
}
diff --git a/src/arenas/connectFour/public.php b/src/arenas/connectFour/public.php
index fda7c86..7499db2 100644
--- a/src/arenas/connectFour/public.php
+++ b/src/arenas/connectFour/public.php
@@ -1,8 +1,6 @@