웹소켓 프론트 참고용 (친구목록, 채팅) #201
Closed
jonnwon
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
친구 추가(삭제) 후 혹은 로그인 후 친구리스트를 받기 위해 프론트에서 서버에게 전달해야 하는 형태
{ "type": "friend_list", "sender": "나의 닉네임" }
서버에서 프론트에게 전달하는 친구목록 형태
{ "friendList": [ { "nickname": "gg", "is_online": false }, { "nickname": "geonwule", "is_online": false }, { "nickname": "jonchoi", "is_online": true } ] }
프론트에서 서버에게 전달해야 하는 채팅 데이터 형태
전체 채팅의 경우:
{ "type": "all_chat", "sender": "jonchoi", "message": "hollo hello all_chat" }
귓속말의 경우:
{ "type": "dm_chat", "sender": "jonchoi", "receiver": "geonwule", "message": "Hi Hi dm chat" }
서버에서 프론트에게 전달되는 채팅 데이터 형태
전체 채팅의 경우:
{ "type": "all_chat", "sender": "jonchoi", "message": "hollo hello all_chat" }
귓속말의 경우:
{ "type": "dm_chat", "sender": "jonchoi", "message": "hollo hello dm_chat" }
Beta Was this translation helpful? Give feedback.
All reactions