From cad2b778cce94c8049d4d5be80b848b7aa6cd5a8 Mon Sep 17 00:00:00 2001 From: gnieark Date: Thu, 16 Jun 2016 00:17:45 +0200 Subject: [PATCH] fulll logs --- src/arenas/connectFour/act.php | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/arenas/connectFour/act.php b/src/arenas/connectFour/act.php index 708c9df..3fd4e62 100644 --- a/src/arenas/connectFour/act.php +++ b/src/arenas/connectFour/act.php @@ -132,7 +132,15 @@ switch ($_POST['act']){ }else{ $anwserPlayer = -1; } - + + if($_POST['fullLogs'] == "true"){ + $fullLogs='Arena send to '.$currentBotName.''.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){