🐛 correction of a bug that occurs when multiple Game at the same time
continuous-integration/drone/push Build is passing Details

deployement
Vincent ASTOLFI 11 months ago
parent ddb874a6a1
commit b3e5cd9b21

@ -66,9 +66,8 @@ io.on("connection", (socket) => {
}); });
socket.on("get ennemy", (roomId, id, callack) => { socket.on("get ennemy", (roomId, id, callack) => {
const out = players.find((p) => p.id !== id) const room = rooms.find((r) => r.id === roomId);
//const out = rooms.find((r) => r.id === roomId) const out = room.players.find((p) => p.id !== id);
// .players.find((p) => p.id !== id);
callack({ callack({
player: out, player: out,
@ -99,7 +98,6 @@ io.on("connection", (socket) => {
}); });
const askToPlay = (game) => { const askToPlay = (game) => {
console.log(game.actualPlayer)
io.to(game.actualPlayer).emit("play"); io.to(game.actualPlayer).emit("play");
}; };

Loading…
Cancel
Save