Add game restart and disconnect support

Prevent handling disconnects for games already ended; add a disconnect() method on the SignalR connection and a LocalGame.disconnectAll() helper. Update GameEndedMenu to emit a restart event and adjust displayed messages/labels. Wire a restart() handler in LocalMode that disconnects all players then restarts the game.
This commit is contained in:
Jonas
2026-03-08 12:47:21 +01:00
parent 919bb71f19
commit bb3c482728
5 changed files with 27 additions and 8 deletions
@@ -73,6 +73,11 @@ class LocalGame {
this.gameState?.currentTurn == 1 ? this.player1.playerName : this.player2.playerName;
this.currentDescription = `${playerName} ist dran mit setzen!`;
}
async disconnectAll(){
await this.player1.disconnect();
await this.player2.disconnect();
}
}
export default LocalGame;