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 11, 2025
1 parent fbc0ce1 commit dc27445
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions socket/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,7 @@ io.on("connection", (socket) => {
socket.on("rejoin_room", ({ room_player, room_code }) => {
const room = ROOMS[room_code];

if (!room) {
socket.emit("err_socket", { err_socket: "ROOM_NOT_FOUND" });
return;
}

if (room.state === "finished") {
socket.emit("err_socket", { err_socket: "ROOM_STATE_ERROR_FINISHED" });
return;
}
if (!room) return;

const player = room.players.find(player => player.room_player === room_player);
if (player) {
Expand Down

0 comments on commit dc27445

Please sign in to comment.