File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
backend/src/main/java/io/f1/backend/domain/game/app Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change 11package io .f1 .backend .domain .game .app ;
22
3- import static io .f1 .backend .domain .game .mapper .RoomMapper .ofPlayerEvent ;
4- import static io .f1 .backend .domain .game .mapper .RoomMapper .toGameResultListResponse ;
5- import static io .f1 .backend .domain .game .mapper .RoomMapper .toQuestionResultResponse ;
6- import static io .f1 .backend .domain .game .mapper .RoomMapper .toQuestionStartResponse ;
7- import static io .f1 .backend .domain .game .mapper .RoomMapper .toRankUpdateResponse ;
3+ import static io .f1 .backend .domain .game .mapper .RoomMapper .*;
84import static io .f1 .backend .domain .game .websocket .WebSocketUtils .getDestination ;
95import static io .f1 .backend .domain .quiz .mapper .QuizMapper .toGameStartResponse ;
106
@@ -108,6 +104,7 @@ public void onCorrectAnswer(GameCorrectAnswerEvent event) {
108104 timerService .cancelTimer (room );
109105
110106 if (!timerService .validateCurrentRound (room )) {
107+ gameEnd (room );
111108 return ;
112109 }
113110
@@ -170,9 +167,9 @@ public void gameEnd(Room room) {
170167 room .updateRoomState (RoomState .WAITING );
171168
172169 messageSender .send (
173- destination ,
174- MessageType .GAME_SETTING ,
175- toGameSettingResponse (room .getGameSetting (), room .getCurrentQuestion ().getQuiz ( )));
170+ destination ,
171+ MessageType .GAME_SETTING ,
172+ toGameSettingResponse (room .getGameSetting (), quizService . getQuizWithQuestionsById ( room .getGameSetting ().getQuizId () )));
176173 messageSender .send (destination , MessageType .ROOM_SETTING , toRoomSettingResponse (room ));
177174 }
178175
You can’t perform that action at this time.
0 commit comments