Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] 술래잡기 종료 로직, 메세지 변경 #93

Merged
merged 2 commits into from
Nov 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading