Skip to content

Commit a677f92

Browse files
committed
fix: resolve conflict
1 parent 3f93d0f commit a677f92

8 files changed

Lines changed: 11 additions & 77 deletions

File tree

src/main/java/com/kospot/application/multi/flow/PlayerTransitionService.java

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

src/main/java/com/kospot/application/multi/game/strategy/RoadViewSoloStartStrategy.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,9 @@ public boolean supports(GameMode gameMode, PlayerMatchType matchType) {
3232
}
3333

3434
/**
35-
<<<<<<< HEAD
3635
* 로드뷰 개인전 시작 컨텍스트를 구성해 게임, 플레이어 정보를 준비
37-
=======
3836
* 로드뷰 개인전 시작 컨텍스트를 구성해 게임, 플레이어 정보를 준비한다.
3937
* Factory로 게임/플레이어 생성을 위임하고, Mapper로 DTO 변환을 위임한다.
40-
>>>>>>> b6ea0d14dbf42f0519020a45269942e57b63af7e
4138
*/
4239
@Override
4340
public StartGamePreparation prepare(GameRoom gameRoom,

src/main/java/com/kospot/application/multi/game/usecase/NotifyStartGameUseCase.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import com.kospot.infrastructure.exception.payload.code.ErrorStatus;
1414
import com.kospot.infrastructure.websocket.domain.multi.game.service.GameNotificationService;
1515
import com.kospot.presentation.multi.flow.dto.message.RoomGameStartMessage;
16+
import com.kospot.presentation.multi.game.dto.request.MultiGameRequest;
1617
import com.kospot.presentation.multi.game.dto.response.MultiGameResponse;
1718
import lombok.RequiredArgsConstructor;
1819
import lombok.extern.slf4j.Slf4j;
@@ -72,7 +73,6 @@ public MultiGameResponse.StartGame execute(Member host, Long gameRoomId) {
7273
return response;
7374
}
7475

75-
<<<<<<< HEAD
7676
private GameMode resolveGameMode(GameRoom gameRoom, MultiGameRequest.Start request) {
7777
String gameModeKey = request.getGameModeKey();
7878
if (gameModeKey == null || gameModeKey.isBlank()) {
@@ -88,13 +88,14 @@ private PlayerMatchType resolveMatchType(GameRoom gameRoom, MultiGameRequest.Sta
8888
return gameRoom.getPlayerMatchType();
8989
}
9090
return PlayerMatchType.fromKey(matchTypeKey);
91-
=======
91+
}
92+
9293
private MultiGameStartStrategy findStrategy(GameMode gameMode, PlayerMatchType matchType) {
9394
return startStrategies.stream()
9495
.filter(it -> it.supports(gameMode, matchType))
9596
.findFirst()
9697
.orElseThrow(() -> new GameHandler(ErrorStatus.GAME_TYPE_NOT_FOUND));
97-
>>>>>>> b6ea0d14dbf42f0519020a45269942e57b63af7e
98+
9899
}
99100

100101

src/main/java/com/kospot/application/multi/round/listener/RoundCompletionEventListener.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,8 @@ public class RoundCompletionEventListener {
3939

4040
// Domain Adaptor
4141
private final MultiRoadViewGameAdaptor multiRoadViewGameAdaptor;
42-
<<<<<<< HEAD
43-
private final GamePlayerAdaptor gamePlayerAdaptor;
44-
=======
4542

4643
// Infrastructure Services (직접 사용)
47-
>>>>>>> b6ea0d14dbf42f0519020a45269942e57b63af7e
4844
private final GameRoundNotificationService gameRoundNotificationService;
4945
private final GameTimerService gameTimerService;
5046

src/main/java/com/kospot/application/multi/round/roadview/CheckAndCompleteRoundEarlyUseCase.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ public boolean execute(String gameRoomId, Long gameId, Long roundId,
5151
return true;
5252
}
5353

54-
<<<<<<< HEAD
5554
private boolean completeRoundEarly(String gameRoomId, Long gameId, Long roundId,
5655
GameMode mode, PlayerMatchType matchType) {
5756
RoadViewGameRound round = roadViewGameRoundAdaptor.queryById(roundId);
@@ -78,8 +77,6 @@ private boolean completeRoundEarly(String gameRoomId, Long gameId, Long roundId,
7877

7978
return true;
8079
}
81-
=======
82-
>>>>>>> b6ea0d14dbf42f0519020a45269942e57b63af7e
8380

8481
/**
8582
* 매치 타입에 따른 예상 제출 수 계산

src/main/java/com/kospot/application/multi/round/roadview/NextRoadViewRoundUseCase.java

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
package com.kospot.application.multi.round.roadview;
22

33
import com.kospot.application.multi.flow.MultiGameFlowScheduler;
4-
<<<<<<< HEAD
54
import com.kospot.application.multi.game.service.CancelMultiGameService;
65
import com.kospot.domain.multi.game.adaptor.MultiRoadViewGameAdaptor;
7-
=======
8-
>>>>>>> b6ea0d14dbf42f0519020a45269942e57b63af7e
96
import com.kospot.domain.multi.game.entity.MultiRoadViewGame;
107
import com.kospot.domain.multi.room.vo.GameRoomStatus;
118
import com.kospot.domain.multi.round.entity.RoadViewGameRound;
@@ -38,6 +35,7 @@ public class NextRoadViewRoundUseCase {
3835

3936
// Domain Service
4037
private final RoundPreparationService roundPreparationService;
38+
private final MultiRoadViewGameAdaptor multiRoadViewGameAdaptor;
4139

4240
// Infrastructure Services (직접 사용)
4341
private final MultiGameRedisService multiGameRedisService;
@@ -52,24 +50,17 @@ public class NextRoadViewRoundUseCase {
5250
* 모든 플레이어 로딩이 끝난 직후 호출되어 1라운드를 준비한다.
5351
*/
5452
public MultiRoadViewGameResponse.StartPlayerGame executeInitial(Long roomId, Long gameId) {
55-
<<<<<<< HEAD
5653
// 활성 플레이어 검증 (안전장치)
5754
if (cancelMultiGameService.cancelIfNoActivePlayers(roomId, gameId)) {
5855
log.info("Game cancelled before initial round - no active players. RoomId: {}, GameId: {}", roomId, gameId);
5956
return null;
6057
}
6158

62-
MultiRoadViewGame game = multiRoadViewGameAdaptor.queryById(gameId);
63-
if (game.isInProgress()) {
64-
log.info("Game already started - skip initial execution. GameId: {}", gameId);
65-
=======
6659
// 도메인 서비스에 라운드 준비 위임
6760
RoundPreparationService.InitialRoundResult result =
6861
roundPreparationService.prepareInitialRound(gameId);
69-
7062
if (result == null) {
7163
log.info("Initial round already prepared - RoomId: {}, GameId: {}", roomId, gameId);
72-
>>>>>>> b6ea0d14dbf42f0519020a45269942e57b63af7e
7364
return null;
7465
}
7566

@@ -94,20 +85,14 @@ public MultiRoadViewGameResponse.StartPlayerGame executeInitial(Long roomId, Lon
9485
* 라운드가 종료된 뒤 다음 라운드를 준비할 때 사용한다.
9586
*/
9687
public MultiRoadViewGameResponse.NextRound execute(Long roomId, Long gameId) {
97-
<<<<<<< HEAD
9888
// 활성 플레이어 검증 (안전장치)
9989
if (cancelMultiGameService.cancelIfNoActivePlayers(roomId, gameId)) {
10090
log.info("Game cancelled before next round - no active players. RoomId: {}, GameId: {}", roomId, gameId);
10191
return null;
10292
}
103-
104-
MultiRoadViewGame game = multiRoadViewGameAdaptor.queryById(gameId);
105-
game.moveToNextRound();
106-
=======
10793
// 도메인 서비스에 라운드 준비 위임
10894
RoundPreparationService.NextRoundResult result =
10995
roundPreparationService.prepareNextRound(gameId);
110-
>>>>>>> b6ea0d14dbf42f0519020a45269942e57b63af7e
11196

11297
String roomKey = roomId.toString();
11398
long version = multiGameRedisService.incrementRoundVersion(roomKey, result.getRound().getId());
@@ -187,3 +172,4 @@ private void runInTransaction(Runnable runnable) {
187172
});
188173
}
189174
}
175+

src/main/java/com/kospot/presentation/multi/game/controller/MultiGameWebSocketController.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.kospot.presentation.multi.game.controller;
22

3-
import com.kospot.application.multi.flow.PlayerTransitionService;
3+
import com.kospot.application.multi.flow.GameTransitionOrchestrator;
4+
import com.kospot.application.multi.flow.LoadingPhaseService;
45
import com.kospot.application.multi.game.websocket.usecase.SendSoloGameMessageUseCase;
56
import com.kospot.presentation.chat.dto.request.ChatMessageDto;
67
import com.kospot.presentation.multi.game.dto.message.LoadingAckMessage;
@@ -17,15 +18,15 @@
1718
@RequiredArgsConstructor
1819
public class MultiGameWebSocketController {
1920

20-
private final PlayerTransitionService playerTransitionService;
21+
private final GameTransitionOrchestrator gameTransitionOrchestrator;
2122

2223
private final SendSoloGameMessageUseCase sendSoloGameMessageUseCase;
2324

2425
@MessageMapping("/room.{roomId}.loading.ack")
2526
public void handleLoadingAck(@DestinationVariable("roomId") String roomId,
2627
@Payload LoadingAckMessage message,
2728
SimpMessageHeaderAccessor headerAccessor) {
28-
playerTransitionService.handleLoadingAck(roomId, message, headerAccessor);
29+
gameTransitionOrchestrator.handleLoadingAck(roomId, message, headerAccessor);
2930
}
3031

3132
@MessageMapping("/room.{roomId}.game.global.chat")

src/test/java/com/kospot/application/multi/round/roadview/NextRoadViewRoundUseCaseTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ void setUp() {
9494
gameTimerService,
9595
multiGameFlowScheduler,
9696
multiGameRedisService,
97-
transactionManager
97+
transactionManager,
9898
);
9999
}
100100

0 commit comments

Comments
 (0)