diff --git a/src/game/GameManager.ts b/src/game/GameManager.ts index a1c88e2..a92c4d8 100644 --- a/src/game/GameManager.ts +++ b/src/game/GameManager.ts @@ -191,8 +191,12 @@ export class GameManager { this.rtmt.listenOnClientConnectionChange((clientId: string, isOnline: boolean) => { const game = this.gameStore.getGameByUser(clientId); if (game) this.sendUserConnectionInfo(game); - const speactatingGameIds = this.gameStore.getSpeactatingGameIdsByUser(clientId); - speactatingGameIds.forEach((gameId) => this.removeSpectator(clientId, gameId)); + if (!isOnline) { + const speactatingGameIds = this.gameStore.getSpeactatingGameIdsByUser(clientId); + speactatingGameIds.forEach((gameId) => this.removeSpectator(clientId, gameId)); + } else { + game && this.rtmt.sendMessage(clientId, channel_on_game_update, game); + } }); } } \ No newline at end of file