Skip to content

Commit

Permalink
Merge pull request #122 from boostcampwm-2024/feature-be-#121
Browse files Browse the repository at this point in the history
[BE] 시그널링 서버에서 사용자의 닉네임을 리턴한다.
  • Loading branch information
dev-taewon-kim authored Nov 19, 2024
2 parents 06d359f + 3a31578 commit 570f85b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions be/signalingServer/src/services/room.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class RoomService {
* sdp: RTCSessionDescription,
* candidates: RTCIceCandidate[],
* deviceId: string, // 오디오 장치 ID
* playerNickname: string, // 닉네임
* timestamp: number // 마지막 업데이트 시간
* }
*/
Expand Down
5 changes: 3 additions & 2 deletions be/signalingServer/src/services/socket.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ class SocketService {

// 방 참가 요청 처리
socket.on("join_room", (data) => {
const { roomId, sdp, candidates, deviceId } = data;
console.log(`[SocketService] 사용자 ${socket.id}가 방 ${roomId} 참가 요청`);
const { roomId, sdp, candidates, deviceId, playerNickname } = data;
console.log(`[SocketService] 사용자 ${socket.id}(닉네임 ${playerNickname})가 방 ${roomId} 참가 요청`);

// 방에 사용자 추가
socket.join(roomId);
this.roomService.addUser(roomId, socket.id, {
sdp,
candidates,
deviceId,
playerNickname,
});

// 방의 모든 사용자에게 업데이트된 정보 전송
Expand Down

0 comments on commit 570f85b

Please sign in to comment.