Skip to content

Commit 6061c87

Browse files
committed
♻️ 오류 해결
1 parent 357443d commit 6061c87

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public void initializeRoomSocket(Long roomId, String sessionId, UserPrincipal pr
133133

134134
Player player = createPlayer(principal);
135135

136-
room.addPlayer(getCurrentUserId(), sessionId, player);
136+
room.addPlayer( sessionId, player);
137137

138138
RoomSettingResponse roomSettingResponse = toRoomSettingResponse(room);
139139

backend/src/main/java/io/f1/backend/domain/game/model/Room.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ public int getCurrentUserCnt() {
5959
return validatedUserIds.size();
6060
}
6161

62-
public void addPlayer(Long userId, String sessionId, Player player) {
63-
62+
public void addPlayer(String sessionId, Player player) {
63+
Long userId = player.getId();
6464
if (!validatedUserIds.contains(userId)) {
6565
throw new CustomException(RoomErrorCode.ROOM_ENTER_REQUIRED);
6666
}
6767

68-
if (isHost(player.getId())) {
68+
if (isHost(userId)) {
6969
player.toggleReady();
7070
}
7171
playerSessionMap.put(sessionId, player);

0 commit comments

Comments
 (0)