Skip to content

Commit

Permalink
Merge pull request #93 from KU-Taverse/fix/taggame
Browse files Browse the repository at this point in the history
[Fix] 술래잡기 종료 로직, 메세지 변경
  • Loading branch information
david-parkk authored Nov 7, 2024
2 parents cec4444 + 0ff8ffe commit 6711b28
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ private void taggerWin(TagGameRoom tagGameRoom) {
tagGameUserRepository.get(player.getKey())
.doOnNext( tagGameUser -> {
if(tagGameUser.getRole() == Role.TAGGER){
sendLoseMessage(player.getValue());
sendWinMessage(player.getValue());
return;
}
sendWinMessage(player.getValue());
sendLoseMessage(player.getValue());
})
.subscribe();
});
Expand All @@ -57,16 +57,16 @@ private void playerWin(TagGameRoom tagGameRoom) {
tagGameUserRepository.get(player.getKey())
.doOnNext( tagGameUser -> {
if(tagGameUser.getRole() == Role.PLAYER){
sendLoseMessage(player.getValue());
sendWinMessage(player.getValue());
return;
}
sendWinMessage(player.getValue());
sendLoseMessage(player.getValue());
}).subscribe();
});
}

private void sendWinMessage(WebSocketSession webSocketSession) {
String winMessage = "승리하였습니다.";
String winMessage = "win";
TagGameEndResponse tagGameEndResponse = TagGameEndResponse.toDto(winMessage);
try {
String jsonMessage = objectMapper.writeValueAsString(tagGameEndResponse);
Expand All @@ -76,7 +76,7 @@ private void sendWinMessage(WebSocketSession webSocketSession) {
}

private void sendLoseMessage(WebSocketSession webSocketSession) {
String winMessage = "패배하였습니다.";
String winMessage = "lose";
TagGameEndResponse tagGameEndResponse = TagGameEndResponse.toDto(winMessage);
try {
String jsonMessage = objectMapper.writeValueAsString(tagGameEndResponse);
Expand Down

0 comments on commit 6711b28

Please sign in to comment.