Skip to content

Commit

Permalink
fix: 발음 게임 결과 로직 수정 (#147)
Browse files Browse the repository at this point in the history
  • Loading branch information
student079 authored Nov 24, 2024
1 parent d82a027 commit fcd16d8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions be/gameServer/src/modules/games/games.gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export class GamesGateway implements OnGatewayDisconnect {
voiceResultFromServerDto;

this.logger.log(
`Received voice result for roomId: ${roomId}, player: ${playerNickname}`,
`Received voice result for roomId: ${roomId}, player: ${playerNickname}, averageNote: ${averageNote}, pronounceScore: ${pronounceScore}`,
);

const gameDataString = await this.redisService.get<string>(
Expand All @@ -197,7 +197,7 @@ export class GamesGateway implements OnGatewayDisconnect {

const gameData: GameDataDto = JSON.parse(gameDataString);

if (averageNote) {
if (averageNote !== undefined) {
const note = noteToNumber(averageNote);
this.logger.log(
`Processing averageNote for player ${playerNickname}: ${note}`,
Expand All @@ -221,7 +221,7 @@ export class GamesGateway implements OnGatewayDisconnect {
});
removePlayerFromGame(gameData, playerNickname);
}
} else if (pronounceScore) {
} else if (pronounceScore !== undefined) {
this.logger.log(
`Processing pronounceScore for player ${playerNickname}: ${pronounceScore}`,
);
Expand All @@ -237,6 +237,8 @@ export class GamesGateway implements OnGatewayDisconnect {
});
removePlayerFromGame(gameData, playerNickname);
}
} else {
this.logger.log('pronounceScore nor averageNote');
}
updatePreviousPlayers(gameData, playerNickname);
gameData.currentTurn++;
Expand Down

0 comments on commit fcd16d8

Please sign in to comment.