x
This commit is contained in:
@@ -17,11 +17,12 @@ class Game{
|
||||
setInterval(() => {
|
||||
this.io.to(`game-${this.code}`).emit("waitForStart", this.players.length);
|
||||
this.io.to(`game-${this.code}`).emit("randomTest", Math.floor(Math.random() * 1000) + 1);
|
||||
}, 1000);
|
||||
}, 100);
|
||||
}
|
||||
|
||||
addUser(user){
|
||||
if(this.players.length >= 2) return 1;
|
||||
|
||||
this.players.push(user);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,13 +30,12 @@ class GameManager {
|
||||
});
|
||||
});
|
||||
|
||||
console.log(oldLobbySave)
|
||||
|
||||
if(!wasInLobby) return 1;
|
||||
|
||||
if(!oldLobbySave.gameCode){
|
||||
const code = this.generateNonExistingCode();
|
||||
const game = new Game(this.io, this, code);
|
||||
|
||||
this.games.set(code, game);
|
||||
|
||||
oldLobbySave.gameCode = code;
|
||||
|
||||
Reference in New Issue
Block a user