Skip to content

Commit

Permalink
fix: 탈주시 탈락처리
Browse files Browse the repository at this point in the history
  • Loading branch information
student079 committed Dec 3, 2024
1 parent e63fd72 commit f5de66a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions be/gameServer/src/modules/games/games.gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,17 @@ export class GamesGateway implements OnGatewayDisconnect {
this.server.to(roomId).emit('updateUsers', gameData.players);

if (playerNickname === gameData.currentPlayer) {
updatePreviousPlayers(gameData, playerNickname);
gameData.currentTurn++;
this.logger.log(`Turn updated: ${gameData.currentTurn}`);
gameData.currentPlayer = selectCurrentPlayer(
gameData.alivePlayers,
gameData.previousPlayers,
);
await this.redisService.set(
`game:${roomId}`,
JSON.stringify(gameData),
);
this.logger.log(`leaved player === currentPlayer: ${playerNickname}`);
setTimeout(() => {
this.server.to(roomId).emit('voiceProcessingResult', {
Expand Down

0 comments on commit f5de66a

Please sign in to comment.