Toggle navigation
Toggle navigation
This project
Loading...
Sign in
강동현
/
nodejs-game
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Overnap
2021-06-10 14:29:48 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6ac8ec1d0aaf03ecd613ec0c085f976835894e36
6ac8ec1d
1 parent
e74dafcb
Builds for 1 pipeline
failed
in 1 minute 13 seconds
클라이언트 핑퐁 추가
Changes
1
Builds
3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
web/src/pages/Room.tsx
web/src/pages/Room.tsx
View file @
6ac8ec1
...
...
@@ -73,6 +73,10 @@ const Room: React.FC = () => {
}
}, [roomData]);
const handlePing = useCallback(() => {
socket.emit('ping', {}, () => {});
}, []);
useEffect(() => {
socket.on('msg', handleUpdateRoomUser);
...
...
@@ -90,9 +94,11 @@ const Room: React.FC = () => {
setRoomData(location.state.roomData);
socket.on('msg', handleInGame);
socket.on('ping', handlePing);
return () => {
socket.off('msg', handleInGame);
socket.off('ping', handlePing);
const rawMessage: RawMessage = {
type: MessageType.ROOM_LEAVE,
...
...
Please
register
or
login
to post a comment