From 8ba99b66051c437d8a4e343b3ca35d6d1550ae8e Mon Sep 17 00:00:00 2001 From: yejinleee Date: Wed, 10 Apr 2024 23:12:35 +0900 Subject: [PATCH] =?UTF-8?q?[=F0=9F=92=A1comment]=20:=20=EC=A3=BC=EC=84=9D?= =?UTF-8?q?=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/GamePage/GamePage.tsx | 22 ++------------------- src/pages/GamePage/IngameWebsocketLayer.tsx | 3 --- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/src/pages/GamePage/GamePage.tsx b/src/pages/GamePage/GamePage.tsx index 2c50f81a..0088d45a 100644 --- a/src/pages/GamePage/GamePage.tsx +++ b/src/pages/GamePage/GamePage.tsx @@ -14,14 +14,8 @@ const GamePage = () => { const navigate = useNavigate(); const { roomId, setRoomInfo, roomInfo } = useRoomInfoStore(); - const { - publishGameRoom, - // onIngameConnected, - // publishIngame, - // handleConnectIngame, - stompClient, - ingameSubscription, - } = useWebsocket(roomId); + const { publishGameRoom, stompClient, ingameSubscription } = + useWebsocket(roomId); const { gameRoomRes, isRoomWsError, didAdminStart, allMembers } = useGameWaitingRoomStore(); @@ -120,15 +114,3 @@ const GamePage = () => { ); }; export default GamePage; - -/* -useWebsocket 분리.. -처음 GamePage 들어오면 useWebsocket 연결하면서 게임대기룸 웹소켓 연결함 -인게임 시작되면 인게임 웹소켓도 연결해야함. 교체아님 쌓여야함 -인게임 종료되면 인게임 웹소켓 끊어야함!!! <- 쌓이지 않게 -인게임 웹소켓을 분리하고 싶다.. - -구상1 -usWebsocekt에서 ingameSubscription를 반환한다. -이걸로 인게임 unsubscribe 해야해서 .. -*/ diff --git a/src/pages/GamePage/IngameWebsocketLayer.tsx b/src/pages/GamePage/IngameWebsocketLayer.tsx index 1f9237b5..59c3e438 100644 --- a/src/pages/GamePage/IngameWebsocketLayer.tsx +++ b/src/pages/GamePage/IngameWebsocketLayer.tsx @@ -10,9 +10,6 @@ import useIngameWebsocket from './hooks/useIngameWebsocket'; interface IngameWebsocketLayerProps { userId: number; - // publishIngame: PublishIngameType; - // onIngameConnected: () => void; - // handleConnectIngame: (roomId: number) => void; stompClient: MutableRefObject; ingameSubscription: MutableRefObject; }