fulll logs
This commit is contained in:
parent
bd21fd22dd
commit
3b1298ff45
|
@ -1 +1 @@
|
|||
Subproject commit 7c8b786228bb9e1561ff60a2d6f7f6ce91be6fee
|
||||
Subproject commit 1d85f9ef3ecfc42bbc4f3c70d5e37ca9a65f629a
|
|
@ -78,10 +78,20 @@ switch ($_POST['act']){
|
|||
$playerResponse = -1;
|
||||
}
|
||||
|
||||
|
||||
if($_POST['fullLogs'] == "true"){
|
||||
$fullLogs='Arena send to '.$playerName.'<em>'.htmlentities($tempPlayer['messageSend']).'</em><br/>
|
||||
HTTP status: <em>'.htmlentities($tempPlayer['httpStatus']).'</em><br/>
|
||||
Bot anwser: <em>'.htmlentities($tempPlayer['response']).'</em><br/>';
|
||||
|
||||
}else{
|
||||
$fullLogs='';
|
||||
}
|
||||
|
||||
//tester la validité de la réponse
|
||||
if((isset($map[$playerResponse])) && ($map[$playerResponse]=="")){
|
||||
//reponse conforme
|
||||
echo "<p>".$playerName." joue en ".$playerResponse." la nouvelle grille est <br/>";
|
||||
echo "<p>".$fullLogs.$playerName." joue en ".$playerResponse." la nouvelle grille est <br/>";
|
||||
$map[$playerResponse]=$playerCHAR;
|
||||
echo "<table>";
|
||||
for($j=0;$j<3;$j++){
|
||||
|
|
|
@ -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 = '<p>Please wait...</p>';
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@ if(!$postParams){
|
|||
?>
|
||||
</select>
|
||||
</p>
|
||||
<p><input type="checkbox" id="fullLogs"/><label for="fullLogs">view the full logs</label></p>
|
||||
<p><input type="button" value="<?php echo $lang['FIGHT']; ?>" onclick="tictactoe(document.getElementById('bot1').value,document.getElementById('bot2').value,'<?php echo xd_check_input(2); ?>');"></p>
|
||||
<div id="fightResult"></div>
|
||||
</article>
|
||||
|
|
Loading…
Reference in New Issue
Block a user