fix:websocket errors & polict change

This commit is contained in:
2026-01-02 14:26:54 +00:00
parent ef277a3cfd
commit 3a7b1b9794
6 changed files with 64 additions and 42 deletions
+6 -10
View File
@@ -1,4 +1,4 @@
const BiscaGame = require("../classes/BiscaGame");
import BiscaGame from '../classes/BiscaGame.js';
const activeGames = new Map();
@@ -18,16 +18,12 @@ const getGame = (id) => {
};
const removeGame = (id) => {
const game = activeGames.get(id);
const game = activeGames.get(id);
if (game) {
game.stopTimer();
activeGames.delete(id);
console.log(`[Game State] Game removed: ${id}`);
game.stopTimer();
activeGames.delete(id);
console.log(`[Game State] Game removed: ${id}`);
}
};
module.exports = {
createGame,
getGame,
removeGame,
};
export { createGame, getGame, removeGame };