Add Start cooldown & Patch socket event

This commit is contained in:
Ralex91
2024-02-02 13:55:55 +01:00
parent 6c7f31a6d4
commit cd723f7efd
19 changed files with 298 additions and 151 deletions

View File

@@ -1,7 +1,17 @@
import convertTimeToPoint from "../utils/convertTimeToPoint.js"
import { abortCooldown } from "../utils/round.js"
import { abortCooldown } from "../utils/cooldown.js"
const Player = {
checkRoom: (game, io, socket, roomId) => {
if (!game.room || roomId !== game.room) {
io.to(socket.id).emit("game:errorMessage", "Room not found")
console.log("zaza")
return
}
io.to(socket.id).emit("game:successRoom", roomId)
},
join: (game, io, socket, player) => {
if (!player.room || !player.room || game.started) {
return