Skip to content

Commit

Permalink
feat: receive_vote_result 를 보낼때 idDeadPersonPinoco 도 보내도록 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
mssak committed Nov 28, 2024
1 parent de9205f commit 9b45370
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
9 changes: 4 additions & 5 deletions packages/backend/gameserver/src/game/game.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,7 @@ export class GameService {
game.votes[voterId] = targetId;
}

async processVoteResult(gsid: string): Promise<{
voteResult: Record<string, number>;
deadPerson: string;
}> {
async processVoteResult(gsid: string) {
const game = this.games.get(gsid);
if (!game) throw new Error('게임을 찾을 수 없습니다.');

Expand Down Expand Up @@ -125,7 +122,9 @@ export class GameService {
this.startSpeakingPhase(gsid);
}

return { voteResult: voteCount, deadPerson };
const isDeadPersonPinoco = deadPerson === game.pinocoId;

return { voteResult: voteCount, deadPerson, isDeadPersonPinoco };
}

async submitGuess(gsid: string, word: string): Promise<boolean> {
Expand Down
5 changes: 1 addition & 4 deletions packages/backend/gameserver/src/gateway/gateway.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,7 @@ export class GatewayService {
await this.gameService.submitVote(gsid, voterId, targetId);
}

async processVoteResult(gsid: string): Promise<{
voteResult: Record<string, number>;
deadPerson: string;
}> {
async processVoteResult(gsid: string) {
return await this.gameService.processVoteResult(gsid);
}

Expand Down

0 comments on commit 9b45370

Please sign in to comment.