Skip to content

Commit

Permalink
update socket/src/main.js
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianjnuwu committed Jan 6, 2025
1 parent 6f92ec2 commit 41b545d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions socket/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,11 @@ io.on("connection", (socket) => {

// Envia o evento de fim do jogo com o ranking
io.to(room_code).emit("game_end", { ranking });

if (room.state === "finished") {
delete ROOMS[room_code];
console.log(`Sala ${room_code} foi deletada.`);
}

console.log(
`Jogo na sala ${room_code} finalizado! Ranking:`,
Expand Down

0 comments on commit 41b545d

Please sign in to comment.