-
Notifications
You must be signed in to change notification settings - Fork 3
[feat] 플레이어 준비 상태 변경 기능 #57
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
Conversation
| @MessageMapping("/room/ready/{roomId}") | ||
| public void playerReady(@DestinationVariable Long roomId, Message<?> message) { | ||
| StompHeaderAccessor accessor = StompHeaderAccessor.wrap(message); | ||
| String sessionId = accessor.getSessionId(); |
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.
이부분 바로 밑에 getSessionId() 로 대체하시면 될 것 같습니다!
| Player player = roomService.findPlayerInRoomBySessionId(sessionId, roomId); | ||
|
|
||
| player.toggleReady(); | ||
|
|
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.
이런 로직들은 컨트롤러보다 서비스에서 하는게 더 적합하지 않을까요 ?.? 🤔
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.
세상에 서비스에 findPlayerInRoomBySessionId이 메서드만 만들어놓고 컨트롤러에서 다 하고있었네요 바로 수정하겠습니다. 감사합니다!
sehee123
left a comment
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.
수고하셨습니다! 🙌
silver-eunjoo
left a comment
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.
고생하셨습니다!
🛰️ Issue Number
Closes #50
🪐 작업 내용
/room/ready/{roomId}으로 메시지를 SEND할 때마다 사용자의 isReady상태가 토글되고, 해당 방의 구독자들에게 브로드캐스팅 됩니다.📚 Reference
✅ Check List