-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat : 방 나가기 API 구현 #41
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
minseok1015
approved these changes
Dec 5, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵 늦은 시간까지 고생많으셨습니다. rating관련해서 저랑 겹치는 부분은 머지후 수정하도록 하는게 좋을 것 같습니다!!
Comment on lines
81
to
83
public String getUserNicknameById(int userId) { | ||
return users.get(userId).getNickname(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 부분 getUserNickname(int userId)으로 겹쳐있어서 머지하고서 수정하도록 하겠습니다.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
게임 도중 퇴장할 경우 레이팅을 고정값으로 300만큼 감소시킵니다.
BackEnd/src/main/java/server/handler/ExitRoomHandler.java
Lines 60 to 68 in b4ccfaa
나간 유저가 호스트 유저였을 경우, 그 다음으로 방에 들어온 유저에게 호스트를 넘깁니다.
마지막으로 남아있던 유저가 나갔을 경우엔 해당 방 스레드를 종료시킵니다.
BackEnd/src/main/java/server/model/Room.java
Lines 213 to 220 in b4ccfaa
방에 참여 중인 유저 닉네임 리스트를 JsonArray로 감싸 반환합니다.
BackEnd/src/main/java/server/model/Room.java
Lines 222 to 232 in b4ccfaa
현재 제 코드에서는 레이팅이 수정된 후 유저 데이터 파일에 따로 저장하는 부분이 없습니다. 9번 만드시면서 구현해놓으신 것 같아 9번 머지하시면 풀 받아서 게임 도중 퇴장 시 레이팅이 감소할 때도 해당 부분 사용해서 DB에 저장할 수 있도록 하겠습니다.