Skip to content

Commit 80101d0

Browse files
committed
🗑️ remove: 불필요 코드 삭제
1 parent 39d9f54 commit 80101d0

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ public void handlePlayerReady(Long roomId, String sessionId) {
7979
Room room = findRoom(roomId);
8080

8181
Player player = room.getPlayerSessionMap().get(sessionId);
82+
if (player == null) {
83+
throw new CustomException(RoomErrorCode.PLAYER_NOT_FOUND);
84+
}
8285

8386
toggleReadyIfPossible(room, player);
8487

backend/src/main/java/io/f1/backend/domain/game/store/RoomRepository.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,4 @@ public interface RoomRepository {
1515
List<Room> findAll();
1616

1717
void removeRoom(Long roomId);
18-
19-
Optional<Player> findPlayerInRoomBySessionId(Long roomId, String sessionId);
2018
}

backend/src/main/java/io/f1/backend/domain/game/store/RoomRepositoryImpl.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,6 @@ public void removeRoom(Long roomId) {
3636
roomMap.remove(roomId);
3737
}
3838

39-
@Override
40-
public Optional<Player> findPlayerInRoomBySessionId(Long roomId, String sessionId) {
41-
return findRoom(roomId).map(room -> room.getPlayerSessionMap().get(sessionId));
42-
}
43-
4439
// 테스트 전용 메소드
4540
public Room getRoomForTest(Long roomId) {
4641
return roomMap.get(roomId);

0 commit comments

Comments
 (0)