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] 종료 처리 수정 #9

Merged
merged 1 commit into from
Oct 26, 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 @@ -114,6 +114,7 @@ public int getPlayerScore(String userId) {
public void endGameAndNotifyPlayers(MiniGameRequest miniGameRequest) throws JsonProcessingException {
// 어떤 형식으로 데이터를 보낼 것인가?
// 유저1, 유저2, 점수1, 점수2, 누구 승
ObjectMapper objectMapper = new ObjectMapper();

GameResultDTO gameResultDTO = new GameResultDTO();

Expand All @@ -138,8 +139,10 @@ public void endGameAndNotifyPlayers(MiniGameRequest miniGameRequest) throws Json
// });

//
String jsonMessage = objectMapper.writeValueAsString(miniGameRequest);

players.values().forEach(session -> {
session.send(Mono.just(session.textMessage(String.valueOf(miniGameRequest)))).subscribe();
session.send(Mono.just(session.textMessage(jsonMessage))).subscribe();
});

// 게임 데이터를 저장합니다.
Expand Down
Loading