File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
backend/src/main/java/io/f1/backend/domain/game Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -131,8 +131,7 @@ public void enterRoom(RoomValidationRequest request) {
131131 throw new CustomException (RoomErrorCode .ROOM_USER_LIMIT_REACHED );
132132 }
133133
134- if (room .getRoomSetting ().locked ()
135- && !room .getRoomSetting ().password ().equals (request .password ())) {
134+ if (room .isPasswordIncorrect (request .password ())) {
136135 throw new CustomException (RoomErrorCode .WRONG_PASSWORD );
137136 }
138137
Original file line number Diff line number Diff line change @@ -195,4 +195,8 @@ public boolean isSameRoom(Long otherRoomId) {
195195 public boolean isPlayerInState (Long userId , ConnectionState state ) {
196196 return getPlayerState (userId ).equals (state );
197197 }
198+
199+ public boolean isPasswordIncorrect (String password ) {
200+ return roomSetting .locked () && !roomSetting .password ().equals (password );
201+ }
198202}
You can’t perform that action at this time.
0 commit comments