Skip to content

Commit e090bd8

Browse files
committed
♻️ refactor : PR 리뷰 반영 + chat으로 정답 맞혔을 시, Question_start 누락 해결
1 parent 9c4a793 commit e090bd8

File tree

2 files changed

+13
-18
lines changed

2 files changed

+13
-18
lines changed

backend/src/main/java/io/f1/backend/domain/game/app/RoomService.java

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import static io.f1.backend.domain.game.mapper.RoomMapper.toGameSettingResponse;
66
import static io.f1.backend.domain.game.mapper.RoomMapper.toPlayerListResponse;
77
import static io.f1.backend.domain.game.mapper.RoomMapper.toQuestionResultResponse;
8+
import static io.f1.backend.domain.game.mapper.RoomMapper.toQuestionStartResponse;
89
import static io.f1.backend.domain.game.mapper.RoomMapper.toRankUpdateResponse;
910
import static io.f1.backend.domain.game.mapper.RoomMapper.toRoomResponse;
1011
import static io.f1.backend.domain.game.mapper.RoomMapper.toRoomSetting;
@@ -65,7 +66,6 @@ public class RoomService {
6566

6667
private final MessageSender messageSender;
6768

68-
private static final int START_DELAY = 5;
6969
private static final int CONTINUE_DELAY = 3;
7070

7171
private static final String PENDING_SESSION_ID = "PENDING_SESSION_ID";
@@ -256,20 +256,22 @@ public void chat(Long roomId, String sessionId, ChatMessage chatMessage) {
256256
destination,
257257
MessageType.SYSTEM_NOTICE,
258258
ofPlayerEvent(chatMessage.nickname(), RoomEventType.CORRECT_ANSWER));
259-
}
260259

261-
timerService.cancelTimer(room);
260+
timerService.cancelTimer(room);
262261

263-
// TODO : 게임 종료 로직 추가
264-
if (!timerService.validateCurrentRound(room)) {
265-
// 게임 종료 로직
266-
return;
267-
}
262+
// TODO : 게임 종료 로직 추가
263+
if (!timerService.validateCurrentRound(room)) {
264+
// 게임 종료 로직
265+
return;
266+
}
268267

269-
room.increaseCurrentRound();
268+
room.increaseCurrentRound();
270269

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+
}
273275
}
274276

275277
private Player getRemovePlayer(Room room, String sessionId, UserPrincipal principal) {

backend/src/main/java/io/f1/backend/domain/game/dto/GameStartData.java

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)