akegarasu / blivedm-go Goto Github PK
View Code? Open in Web Editor NEWgo 版 b站/bilibili 直播/bili直播 弹幕库 - websocket协议
License: MIT License
go 版 b站/bilibili 直播/bili直播 弹幕库 - websocket协议
License: MIT License
丢失弹幕的概率特别大。似乎这下需要真的挂个Cookie进去了。
OnGuard
事件检测的大航海事件中,舰长/提督/总督价格始终不变,虽然能正确反应上舰但无法正确反馈金额。
USER_TOAST_MSG
可以正确返回大航海的金额、时间、角色、Uid/Uname 字段。
{
"cmd": "USER_TOAST_MSG",
"data": {
"anchor_show": true,
"color": "#00D1F1",
"dmscore": 90,
"effect_id": 397,
"end_time": 1662041450,
"face_effect_id": 44,
"gift_id": 10003,
"guard_level": 3,
"is_show": 0,
"num": 1,
"op_type": 3,
"payflow_id": "2209012210331402119576078",
"price": 138000,
"role_name": "舰长",
"room_effect_id": 590,
"start_time": 1662041450,
"svga_block": 0,
"target_guard_count": 24,
"toast_msg": "<%七星虞乐%> 自动续费了舰长",
"uid": 30491957,
"unit": "月",
"user_show": true,
"username": "七星虞乐"
}
}
请问可以根据用户的弹幕,实现在直播间自动回复弹幕消息嘛
日志:
INFO[0000] reconnect err:websocket: close 1006 (abnormal closure): unexpected EOF
dm_v2是protobuf,有空补上
race condition.
panic: concurrent write to websocket connection
Two goroutines are simultaneously writing messages: one from heartBeatLoop
and the other from wsLoop
during reconnection.
trackback
panic: concurrent write to websocket connection
goroutine 179 [running]:
github.com/gorilla/websocket.(*messageWriter).flushFrame(0xc005ddec90, 0x1, {0x0?, 0x0?, 0x0?})
C:/Users/vboxuser/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:617 +0x4b8
github.com/gorilla/websocket.(*messageWriter).Close(0xc0090494a0?)
C:/Users/vboxuser/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:731 +0x35
github.com/gorilla/websocket.(*Conn).beginMessage(0xc00741e580, 0xc0090494a0, 0x2)
C:/Users/vboxuser/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:480 +0x3a
github.com/gorilla/websocket.(*Conn).NextWriter(0xc00741e580, 0x2)
C:/Users/vboxuser/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:520 +0x3f
github.com/gorilla/websocket.(*Conn).WriteMessage(0x20c2e75b?, 0x0?, {0xc00aed83c0, 0x125, 0x140})
C:/Users/vboxuser/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:773 +0x137
github.com/AynaLivePlayer/blivedm-go/client.(*Client).sendEnterPacket(0xc0001b42c0)
C:/Users/vboxuser/go/pkg/mod/github.com/!ayna!live!player/[email protected]/client/client.go:195 +0x55
github.com/AynaLivePlayer/blivedm-go/client.(*Client).connect(0xc0001b42c0)
C:/Users/vboxuser/go/pkg/mod/github.com/!ayna!live!player/[email protected]/client/client.go:118 +0x2cf
github.com/AynaLivePlayer/blivedm-go/client.(*Client).wsLoop(0xc0001b42c0)
C:/Users/vboxuser/go/pkg/mod/github.com/!ayna!live!player/[email protected]/client/client.go:137 +0x1d2
created by github.com/AynaLivePlayer/blivedm-go/client.(*Client).Start in goroutine 51
C:/Users/vboxuser/go/pkg/mod/github.com/!ayna!live!player/[email protected]/client/client.go:174 +0x78
问题好像是因为同时调用了多次groutine,但是我已经上过锁了。
请问礼物和弹幕接口同时用的话有什么办法可以避免并发情况吗。
你发送心跳包 []byte{0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1}没有带p.ProtocolVersion,导致认证失效无法正常收到弹幕。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.