diff --git a/app.js b/app.js index b85290b032dac8380924ad052f96a0707da84b61..c6a6ca9d587c64662f87e1b177f2ec2ca5f6f1b0 100644 --- a/app.js +++ b/app.js @@ -68,7 +68,6 @@ io.on('connection', (socket) => { }); socket.on('roque', (data) => { console.log(`[Server] Play reçu : ${JSON.stringify(data)}`); // Debugging -<<<<<<< Updated upstream socket.broadcast.emit('roque', data); // On diffuse à tous les clients }); @@ -76,11 +75,6 @@ io.on('connection', (socket) => { socket.broadcast.emit('echec'); }); -======= - - socket.broadcast.emit('roque', data); // On diffuse à tous les clients - }); ->>>>>>> Stashed changes socket.on('play again', (roomId) => { const room = rooms.find(r => r.id === roomId); diff --git a/htdocs/index.js b/htdocs/index.js index 8f12958dbb4e8b609ac30e8c135b6044b33f6a77..a534d6006801df041390451ae2c260316fcc8c0b 100644 --- a/htdocs/index.js +++ b/htdocs/index.js @@ -501,20 +501,12 @@ function highlightMoves(tour,piece, row, col) { } } if (row==0 && col == 4) {//position roi noir d'origine -<<<<<<< Updated upstream if (board[0][3] === "" && board[0][2] ==="" && board[0][1] ==="" && board[0][0] ==="T"){//rock à gauche -======= - if (board[0][3] === "" && board[0][2] ==="" && board[0][1] ==="" && board[0][0] ==="t"){//rock à gauche ->>>>>>> Stashed changes let newRow = row; let newCol = 2; moves.push({ row: newRow, col: newCol }); } -<<<<<<< Updated upstream if (board[0][5] === "" && board[0][6] ==="" && board[0][7] ==="T"){//rock à droite -======= - if (board[0][5] === "" && board[0][6] ==="" && board[0][7] ==="t"){//rock à droite ->>>>>>> Stashed changes let newRow = row; let newCol = 6; moves.push({ row: newRow, col: newCol }); @@ -701,14 +693,11 @@ function movePiece(piece, newRow, newCol) { piece: selectedPiece // Nom de la pièce (ex: "pion", "tour", etc.) } }); -<<<<<<< Updated upstream if (echec(board)){ socket.emit('echec'); } -======= ->>>>>>> Stashed changes //Verifie si c'était un rock if (piece.toLowerCase() == "k" && Math.abs(newCol-selectedPosition.col)==2){ if (newCol-selectedPosition.col==2){//rock à droite @@ -747,11 +736,7 @@ function movePiece(piece, newRow, newCol) { to: { x: 7, y: 3 }, // Position d'arrivée piece: "t"} }) -<<<<<<< Updated upstream } else if (player.isBlackPlayer){ -======= - } else { ->>>>>>> Stashed changes board[0][3]="T" board[0][0]="" socket.emit('roque', {