Erneutes Spielen sicherer Gemacht

This commit is contained in:
2025-05-06 17:04:54 +02:00
parent 9b56ad321a
commit 6607cd500e
4 changed files with 77 additions and 30 deletions

View File

@@ -78,6 +78,9 @@ class Game{
Nur wenn noch beide Spieler da sind
*/
let replayPossible = false;
const replayTime = 5000;
if(this.players.length === 2){
const lobbyManager = this.gameManager.lobbyManager;
@@ -92,16 +95,22 @@ class Game{
0,
newUserList,
lobbyManager,
10000
replayTime
);
lobbyManager.oldLobbys.push(tempLobby);
replayPossible = true;
}
this.io.to(`game-${this.code}`).emit("gameEnd", {
msg: msg,
score: this.score,
rang: scoreDb?.rank || "-"
rang: scoreDb?.rank || "-",
replay: {
possible: replayPossible,
time: replayTime
}
});
}