Skip to content

Commit e918864

Browse files
committed
Merge remote-tracking branch 'origin/refactor/163' into refactor/163
# Conflicts: # backend/src/main/java/io/f1/backend/domain/game/app/RoomService.java # backend/src/main/java/io/f1/backend/domain/game/websocket/eventlistener/WebsocketEventListener.java # backend/src/main/java/io/f1/backend/global/lock/LockExecutor.java
2 parents aa744ce + c7f91ac commit e918864

File tree

6 files changed

+228
-180
lines changed

6 files changed

+228
-180
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,8 @@ private void changeHost(Room room, Player host) {
403403

404404
public void exitRoomForDisconnectedPlayer(Long roomId, Player player) {
405405
lockExecutor.executeWithLock(
406-
USER_LOCK_PREFIX, player.getId(), () -> {
407-
lockExecutor.executeWithLock(ROOM_LOCK_PREFIX, roomId, () -> {
406+
USER_LOCK_PREFIX,player.getId(),()->{
407+
lockExecutor.executeWithLock(ROOM_LOCK_PREFIX, roomId,()->{
408408
// 연결 끊긴 플레이어 exit 로직 타게 해주기
409409
Room room = findRoom(roomId);
410410

backend/src/main/java/io/f1/backend/domain/game/websocket/controller/GameSocketController.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ public void initializeRoomSocket(@DestinationVariable Long roomId, Message<?> me
4141
public void reconnect(@DestinationVariable Long roomId, Message<?> message) {
4242

4343
UserPrincipal principal = getSessionUser(message);
44-
roomService.changeConnectedStatusWithLock(roomId, principal.getUserId(), ConnectionState.CONNECTED);
44+
roomService.changeConnectedStatusWithLock(
45+
roomId, principal.getUserId(), ConnectionState.CONNECTED);
4546
roomService.reconnectSendResponseWithLock(roomId, principal);
4647
roomService.addSessionRoomId(getSessionId(message), roomId);
4748
}

backend/src/main/java/io/f1/backend/global/exception/errorcode/CommonErrorCode.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ public enum CommonErrorCode implements ErrorCode {
1616
LOCK_ACQUISITION_FAILED("E409003", HttpStatus.CONFLICT, "다른 요청이 작업 중입니다. 잠시 후 다시 시도해주세요."),
1717
LOCK_INTERRUPTED("E500004", HttpStatus.INTERNAL_SERVER_ERROR, "작업 중 락 획득이 중단되었습니다. 다시 시도해주세요.");
1818

19-
2019
private final String code;
2120

2221
private final HttpStatus httpStatus;

backend/src/test/java/io/f1/backend/domain/game/app/GameFlowTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ static class TestRoomService extends RoomService {
222222
private final Map<Long, Room> rooms = new ConcurrentHashMap<>();
223223

224224
public TestRoomService() {
225-
super(null, null, null, null, null, null,null);
225+
super(null, null, null, null, null, null, null);
226226
}
227227

228228
@Override

0 commit comments

Comments
 (0)