|
5 | 5 | import static io.f1.backend.domain.game.mapper.RoomMapper.toGameSettingResponse; |
6 | 6 | import static io.f1.backend.domain.game.mapper.RoomMapper.toPlayerListResponse; |
7 | 7 | import static io.f1.backend.domain.game.mapper.RoomMapper.toQuestionResultResponse; |
| 8 | +import static io.f1.backend.domain.game.mapper.RoomMapper.toQuestionStartResponse; |
8 | 9 | import static io.f1.backend.domain.game.mapper.RoomMapper.toRankUpdateResponse; |
9 | 10 | import static io.f1.backend.domain.game.mapper.RoomMapper.toRoomResponse; |
10 | 11 | import static io.f1.backend.domain.game.mapper.RoomMapper.toRoomSetting; |
@@ -65,7 +66,6 @@ public class RoomService { |
65 | 66 |
|
66 | 67 | private final MessageSender messageSender; |
67 | 68 |
|
68 | | - private static final int START_DELAY = 5; |
69 | 69 | private static final int CONTINUE_DELAY = 3; |
70 | 70 |
|
71 | 71 | private static final String PENDING_SESSION_ID = "PENDING_SESSION_ID"; |
@@ -256,20 +256,22 @@ public void chat(Long roomId, String sessionId, ChatMessage chatMessage) { |
256 | 256 | destination, |
257 | 257 | MessageType.SYSTEM_NOTICE, |
258 | 258 | ofPlayerEvent(chatMessage.nickname(), RoomEventType.CORRECT_ANSWER)); |
259 | | - } |
260 | 259 |
|
261 | | - timerService.cancelTimer(room); |
| 260 | + timerService.cancelTimer(room); |
262 | 261 |
|
263 | | - // TODO : 게임 종료 로직 추가 |
264 | | - if (!timerService.validateCurrentRound(room)) { |
265 | | - // 게임 종료 로직 |
266 | | - return; |
267 | | - } |
| 262 | + // TODO : 게임 종료 로직 추가 |
| 263 | + if (!timerService.validateCurrentRound(room)) { |
| 264 | + // 게임 종료 로직 |
| 265 | + return; |
| 266 | + } |
268 | 267 |
|
269 | | - room.increaseCurrentRound(); |
| 268 | + room.increaseCurrentRound(); |
270 | 269 |
|
271 | | - // 타이머 추가하기 |
272 | | - timerService.startTimer(room, CONTINUE_DELAY); |
| 270 | + // 타이머 추가하기 |
| 271 | + timerService.startTimer(room, CONTINUE_DELAY); |
| 272 | + messageSender.send(destination, MessageType.QUESTION_START, |
| 273 | + toQuestionStartResponse(room, CONTINUE_DELAY)); |
| 274 | + } |
273 | 275 | } |
274 | 276 |
|
275 | 277 | private Player getRemovePlayer(Room room, String sessionId, UserPrincipal principal) { |
|
0 commit comments