From 3b1298ff456ddd726e46af06bd0ab3a53a1116e2 Mon Sep 17 00:00:00 2001 From: gnieark Date: Thu, 16 Jun 2016 13:41:15 +0200 Subject: [PATCH 1/6] fulll logs --- src/PHPMailer | 2 +- src/arenas/tictactoe/act.php | 12 +++++++++++- src/arenas/tictactoe/js.js | 4 ++-- src/arenas/tictactoe/public.php | 1 + 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/PHPMailer b/src/PHPMailer index 7c8b786..1d85f9e 160000 --- a/src/PHPMailer +++ b/src/PHPMailer @@ -1 +1 @@ -Subproject commit 7c8b786228bb9e1561ff60a2d6f7f6ce91be6fee +Subproject commit 1d85f9ef3ecfc42bbc4f3c70d5e37ca9a65f629a diff --git a/src/arenas/tictactoe/act.php b/src/arenas/tictactoe/act.php index e6b8f78..45c73d7 100644 --- a/src/arenas/tictactoe/act.php +++ b/src/arenas/tictactoe/act.php @@ -78,10 +78,20 @@ switch ($_POST['act']){ $playerResponse = -1; } + + if($_POST['fullLogs'] == "true"){ + $fullLogs='Arena send to '.$playerName.''.htmlentities($tempPlayer['messageSend']).'
+ HTTP status: '.htmlentities($tempPlayer['httpStatus']).'
+ Bot anwser: '.htmlentities($tempPlayer['response']).'
'; + + }else{ + $fullLogs=''; + } + //tester la validité de la réponse if((isset($map[$playerResponse])) && ($map[$playerResponse]=="")){ //reponse conforme - echo "

".$playerName." joue en ".$playerResponse." la nouvelle grille est
"; + echo "

".$fullLogs.$playerName." joue en ".$playerResponse." la nouvelle grille est
"; $map[$playerResponse]=$playerCHAR; echo ""; for($j=0;$j<3;$j++){ diff --git a/src/arenas/tictactoe/js.js b/src/arenas/tictactoe/js.js index 27908da..97bee88 100644 --- a/src/arenas/tictactoe/js.js +++ b/src/arenas/tictactoe/js.js @@ -12,7 +12,7 @@ function Ajx(){ } return request; } -function tictactoe(bot1,bot2,xd_check){ +function tictactoe(bot1,bot2,xd_check,fullLogs){ document.getElementById('fightResult').innerHTML = '

Please wait...

'; var xhr = Ajx(); xhr.onreadystatechange = function(){if(xhr.readyState == 4){ @@ -22,5 +22,5 @@ function tictactoe(bot1,bot2,xd_check){ }}; xhr.open("POST", '/tictactoe', true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - xhr.send('act=fight&bot1=' + bot1 + '&bot2=' + bot2 + '&xd_check=' + xd_check); + xhr.send('act=fight&bot1=' + bot1 + '&bot2=' + bot2 + '&fulLLog' = fullLogs + '&xd_check=' + xd_check); } diff --git a/src/arenas/tictactoe/public.php b/src/arenas/tictactoe/public.php index 87372db..2f965dc 100644 --- a/src/arenas/tictactoe/public.php +++ b/src/arenas/tictactoe/public.php @@ -40,6 +40,7 @@ if(!$postParams){ ?>

+

From e224300241fe4ba56394e5de2c37005edb73f784 Mon Sep 17 00:00:00 2001 From: gnieark Date: Thu, 16 Jun 2016 13:43:26 +0200 Subject: [PATCH 2/6] fulll logs --- src/arenas/tictactoe/public.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arenas/tictactoe/public.php b/src/arenas/tictactoe/public.php index 2f965dc..e849aa4 100644 --- a/src/arenas/tictactoe/public.php +++ b/src/arenas/tictactoe/public.php @@ -41,6 +41,6 @@ if(!$postParams){

-

+

From 20147595262b00de01f1ed81c065da1989ccfcb9 Mon Sep 17 00:00:00 2001 From: gnieark Date: Thu, 16 Jun 2016 13:44:18 +0200 Subject: [PATCH 3/6] fix js --- src/arenas/tictactoe/js.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arenas/tictactoe/js.js b/src/arenas/tictactoe/js.js index 97bee88..d5031f5 100644 --- a/src/arenas/tictactoe/js.js +++ b/src/arenas/tictactoe/js.js @@ -22,5 +22,5 @@ function tictactoe(bot1,bot2,xd_check,fullLogs){ }}; xhr.open("POST", '/tictactoe', true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - xhr.send('act=fight&bot1=' + bot1 + '&bot2=' + bot2 + '&fulLLog' = fullLogs + '&xd_check=' + xd_check); + xhr.send('act=fight&bot1=' + bot1 + '&bot2=' + bot2 + '&fulLLog=' + fullLogs + '&xd_check=' + xd_check); } From 11daf6b1371693ffdb95ef97f8083814e35f02e0 Mon Sep 17 00:00:00 2001 From: gnieark Date: Thu, 16 Jun 2016 13:45:07 +0200 Subject: [PATCH 4/6] fix js --- src/arenas/tictactoe/public.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arenas/tictactoe/public.php b/src/arenas/tictactoe/public.php index e849aa4..07acf45 100644 --- a/src/arenas/tictactoe/public.php +++ b/src/arenas/tictactoe/public.php @@ -41,6 +41,6 @@ if(!$postParams){

-

+

From f030de575fb61956af948523f3d26c7150c0976a Mon Sep 17 00:00:00 2001 From: gnieark Date: Thu, 16 Jun 2016 13:45:56 +0200 Subject: [PATCH 5/6] fix js --- src/arenas/tictactoe/js.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arenas/tictactoe/js.js b/src/arenas/tictactoe/js.js index d5031f5..4480d80 100644 --- a/src/arenas/tictactoe/js.js +++ b/src/arenas/tictactoe/js.js @@ -22,5 +22,5 @@ function tictactoe(bot1,bot2,xd_check,fullLogs){ }}; xhr.open("POST", '/tictactoe', true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - xhr.send('act=fight&bot1=' + bot1 + '&bot2=' + bot2 + '&fulLLog=' + fullLogs + '&xd_check=' + xd_check); + xhr.send('act=fight&bot1=' + bot1 + '&bot2=' + bot2 + '&fulLLogs=' + fullLogs + '&xd_check=' + xd_check); } From 5a866cb270b1d5e1e8a8d0b7c3726a5472f900c2 Mon Sep 17 00:00:00 2001 From: gnieark Date: Thu, 16 Jun 2016 13:46:24 +0200 Subject: [PATCH 6/6] fix js --- src/arenas/tictactoe/js.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arenas/tictactoe/js.js b/src/arenas/tictactoe/js.js index 4480d80..3a4f7d9 100644 --- a/src/arenas/tictactoe/js.js +++ b/src/arenas/tictactoe/js.js @@ -22,5 +22,5 @@ function tictactoe(bot1,bot2,xd_check,fullLogs){ }}; xhr.open("POST", '/tictactoe', true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - xhr.send('act=fight&bot1=' + bot1 + '&bot2=' + bot2 + '&fulLLogs=' + fullLogs + '&xd_check=' + xd_check); + xhr.send('act=fight&bot1=' + bot1 + '&bot2=' + bot2 + '&fullLogs=' + fullLogs + '&xd_check=' + xd_check); }