for debog

pull/85/head
gnieark 8 years ago
parent 01cc1a0cdd
commit cf745f186b

@ -222,7 +222,7 @@ function play(player){
var arrToSend= {
"game-id": "" + gameId,
"action" : "play-turn",
"game" : "connectfour",
"game" : "connectFour",
"players" : 2,
"board" : board,
"you" : symbol,
@ -301,9 +301,9 @@ function startGame(){
var xhr = new XMLHttpRequest();
xhr.open("POST", document.getElementById('url' + p).value, false);
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) {
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{
addLog('player ' + p + ' n est pas joignable ' + xhr.status);
return;

@ -294,7 +294,7 @@ switch ($_POST['act']){
'continue' =>0,
'strikeX' => -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){
save_battle('connectFou',$_SESSION['bot1']['name'],$_SESSION['bot2']['name'],2);

Loading…
Cancel
Save