-
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/67] 매칭 실패 로직 #68
Conversation
const otherSocket = await getSocketIdByMemberId(io, socket.matchingTarget); | ||
|
||
// 26) 매칭 FAIL API 요청 | ||
await updateBothMatchingStatusApi(socket,"FAIL",socket.matchingTarget); | ||
|
||
// 27) 상대 client에게 matching-fail emit | ||
emitMatchingFail(otherSocket); | ||
|
||
// 28) socket.target 제거 | ||
socket.matchingTarget=null; | ||
|
||
// 29) otherSocket.matchingTarget 제거 | ||
otherSocket.matchingTarget=null; |
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.
이 부분이 제가 다른 기능 구현할 때도 그랬었는데,, getSocketIdByMemberId를 할 때 찯을 대상 소켓이 disconnect된 경우에는 아예 여기서 소켓을 찾지 못하더라구요..! 그래서 otherSocket에 대한 null 여부를 체크하고 그 아래 줄부터 실행해야 오류가 안났었습니다!
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.
getSocketIdByMemberId 결과 값 null 체크만 추가해주시면 될 것 같아요 고생하셨습니다!
넵! 수정하겠습니다! |
🚀 개요
매칭 실패 로직 구현했습니다
🔍 변경사항
⏳ 작업 내용
📝 논의사항
26) 매칭 FAIL API 요청
27) 상대 client에게 matching-fail emit
28) socket.target 제거
29) otherSocket.matchingTarget 제거