fanyuecheng / Pica

一个简约的哔咔漫画iOS App
MIT License
397 stars 43 forks source link

[提问]能具体说说哔咔聊天室websocket机制吗 #26

Closed Oveln closed 2 years ago

Oveln commented 2 years ago

维持心跳要给websocket发送什么消息 发送正常信息的格式又是怎么样的 看代码真的看的头晕了抱歉(

fanyuecheng commented 2 years ago

ping:发送字符串"2" 进入:发送字符串 "42["init",json]" json是该用户的info,由"users/profile"获取 消息:发送字符串 "42["send_message",json]"
json是 {"reply":"回复的消息","birthday":"----","title":"----","image":"image base64","block_user_id":"悄悄话对方id","_id":"我的ID","reply_name":"回复对方名字","name":"我的名字","exp":--,"verified":false,"gender":"m--,"level":--,"platform":"android","email":"--","audio":"音频data base64","message":"---","avatar":"---","isPunched":true,"at":"嗶咔_被@名字","created_at":"----","characters":[]}

另外, 你甚至不愿意给我一个star

Oveln commented 2 years ago

噗,谢谢!