for debog

This commit is contained in:
gnieark 2016-06-12 00:08:54 +02:00
parent 01cc1a0cdd
commit cf745f186b
2 changed files with 4 additions and 4 deletions

View File

@ -222,7 +222,7 @@ function play(player){
var arrToSend= { var arrToSend= {
"game-id": "" + gameId, "game-id": "" + gameId,
"action" : "play-turn", "action" : "play-turn",
"game" : "connectfour", "game" : "connectFour",
"players" : 2, "players" : 2,
"board" : board, "board" : board,
"you" : symbol, "you" : symbol,
@ -301,9 +301,9 @@ function startGame(){
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
xhr.open("POST", document.getElementById('url' + p).value, false); xhr.open("POST", document.getElementById('url' + p).value, false);
xhr.setRequestHeader("Content-Type", "application/json"); xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(' {"game-id":"' + gameId + '","action":"init","game":"connectfour","players":2,"board":"","player-index":' + (p - 1) +'}'); xhr.send(' {"game-id":"' + gameId + '","action":"init","game":"connectFour","players":2,"board":"","player-index":' + (p - 1) +'}');
if(xhr.status == 200) { if(xhr.status == 200) {
addLog('Message d\'init envoyé au bot player ' + p + ' {"game-id":"' + gameId + '","action":"init","game":"connectfour","players":2,"board":"","player-index":' + (p - 1) +'} <br/> il a répondu ' + xhr.responseText ); addLog('Message d\'init envoyé au bot player ' + p + ' {"game-id":"' + gameId + '","action":"init","game":"connectFour","players":2,"board":"","player-index":' + (p - 1) +'} <br/> il a répondu ' + xhr.responseText );
}else{ }else{
addLog('player ' + p + ' n est pas joignable ' + xhr.status); addLog('player ' + p + ' n est pas joignable ' + xhr.status);
return; return;

View File

@ -294,7 +294,7 @@ switch ($_POST['act']){
'continue' =>0, 'continue' =>0,
'strikeX' => -1, 'strikeX' => -1,
'strikeY' => -1, 'strikeY' => -1,
'log' => $you." ".$currentBotName." a fait une réponse non conforme, il perd" 'log' => $you." ".$currentBotName." a fait une réponse non conforme, il perd".json_encode($tempPlayer)."|";
); );
if($_SESSION['currentPlayer']==1){ if($_SESSION['currentPlayer']==1){
save_battle('connectFou',$_SESSION['bot1']['name'],$_SESSION['bot2']['name'],2); save_battle('connectFou',$_SESSION['bot1']['name'],$_SESSION['bot2']['name'],2);