Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion components/KeysingyouGameRoom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,11 @@ const KeysingyouGameRoom = ({ user, room, onBack }: GameRoomProps) => {
}
});

sock.on("redirect_lobby", (d) => {
alert(d.reason ?? "서버와 연결이 끊겼습니다.");
handleLeaveRoom();
});

sock.on("room_update", (d: { users: User[] }) => setUsers(d.users));
sock.on("start_failed", (d: { reason: string }) => alert(d.reason));

Expand Down Expand Up @@ -544,8 +549,8 @@ const KeysingyouGameRoom = ({ user, room, onBack }: GameRoomProps) => {
/* ───── 나가기 ───── */
function leaveRoom() {
socket.current?.emit("leave_room");
disconnectSocket();
handleLeaveRoom();
router.push(`/lobby`);
}

// 게임 시작 핸들러 추가 (랜덤송과 동일하게 API 호출)
Expand Down