Kleine Verbesserungen

This commit is contained in:
2025-03-28 10:55:47 +01:00
parent f4cfe1e111
commit 9d186b9ddc
3 changed files with 4 additions and 4 deletions

View File

@@ -14,7 +14,7 @@ class ClientHandler {
this.socket this.socket
); );
this.socket.on("disconnect", () => { this.defaultDisconnect() }) this.socket.on("disconnect", () => { this.defaultDisconnect() });
this.checkForLobby(); this.checkForLobby();
} }

View File

@@ -8,6 +8,7 @@ class Lobby {
constructor(io, lobbyManager, code) { constructor(io, lobbyManager, code) {
this.io = io; this.io = io;
this.lobbyManager = lobbyManager; this.lobbyManager = lobbyManager;
this.code = code; this.code = code;
/** @type {Array<SocketUser>} */ /** @type {Array<SocketUser>} */
this.users = []; this.users = [];
@@ -23,7 +24,6 @@ class Lobby {
this.sendLobbyUserUpdate(); this.sendLobbyUserUpdate();
if(this.users.length === 2) { if(this.users.length === 2) {
console.log("Starte Spiel");
this.startGame(); this.startGame();
} }

View File

@@ -3,13 +3,13 @@ const LobbyManager = require("../LobbyManager");
const SocketUser = require("../../Classes/SocketUser"); const SocketUser = require("../../Classes/SocketUser");
class TemporaryLobby{ class TemporaryLobby{
/** @param { string } code @param {Array<SocketUser>} users @param {LobbyManager} lobbyManager*/ /** @param { string } code @param {Array<SocketUser>} users @param {LobbyManager} lobbyManager */
constructor(code, users, lobbyManager){ constructor(code, users, lobbyManager){
this.code = code; this.code = code;
this.users = users; this.users = users;
this.lobbyManager = lobbyManager; this.lobbyManager = lobbyManager;
setTimeout(this.selfDestroy.bind(this), 5000); setTimeout(this.selfDestroy.bind(this), 4000);
} }
selfDestroy(){ selfDestroy(){