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.on("disconnect", () => { this.defaultDisconnect() })
this.socket.on("disconnect", () => { this.defaultDisconnect() });
this.checkForLobby();
}

View File

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

View File

@@ -3,13 +3,13 @@ const LobbyManager = require("../LobbyManager");
const SocketUser = require("../../Classes/SocketUser");
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){
this.code = code;
this.users = users;
this.lobbyManager = lobbyManager;
setTimeout(this.selfDestroy.bind(this), 5000);
setTimeout(this.selfDestroy.bind(this), 4000);
}
selfDestroy(){