Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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 @@ -176,7 +176,13 @@ public void gameEnd(Room room) {
room.initializePlayers();

List<Player> disconnectedPlayers = room.getDisconnectedPlayers();
roomService.handleDisconnectedPlayers(room, disconnectedPlayers);

if (!disconnectedPlayers.isEmpty()) {
roomService.handleDisconnectedPlayers(room, disconnectedPlayers);
}

messageSender.sendBroadcast(
destination, MessageType.PLAYER_LIST, toPlayerListResponse(room));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SystemNotice 와 플레이어 리스트는 동기화가 되어야하지 않을까합니다!


room.updateRoomState(RoomState.WAITING);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,6 @@ public void exitRoomForDisconnectedPlayer(Long roomId, Player player, String ses
SystemNoticeResponse systemNoticeResponse =
ofPlayerEvent(player.nickname, RoomEventType.EXIT);

messageSender.sendBroadcast(
destination, MessageType.PLAYER_LIST, toPlayerListResponse(room));
messageSender.sendBroadcast(
destination, MessageType.SYSTEM_NOTICE, systemNoticeResponse);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ public void initializePlayers() {
.forEach(
player -> {
player.initializeCorrectCount();
player.toggleReady();
});
resetAllPlayerReadyStates();
}

public String getSessionIdByUserId(Long userId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,14 @@ class RoomServiceTests {

@Mock private RoomRepository roomRepository;
@Mock private QuizService quizService;
@Mock private GameService gameService;
@Mock private TimerService timerService;
@Mock private ApplicationEventPublisher eventPublisher;
@Mock private MessageSender messageSender;

@BeforeEach
void setUp() {
MockitoAnnotations.openMocks(this); // @Mock 어노테이션이 붙은 필드들을 초기화합니다.

roomService =
new RoomService(
timerService, quizService, roomRepository, eventPublisher, messageSender);
roomService = new RoomService(quizService, roomRepository, eventPublisher, messageSender);

SecurityContextHolder.clearContext();
}
Expand Down