summaryrefslogtreecommitdiff
path: root/danmaku/dmpkg
diff options
context:
space:
mode:
Diffstat (limited to 'danmaku/dmpkg')
-rw-r--r--danmaku/dmpkg/auth.go4
-rw-r--r--danmaku/dmpkg/raw.go2
2 files changed, 4 insertions, 2 deletions
diff --git a/danmaku/dmpkg/auth.go b/danmaku/dmpkg/auth.go
index b6a90d3..81c365e 100644
--- a/danmaku/dmpkg/auth.go
+++ b/danmaku/dmpkg/auth.go
@@ -15,17 +15,19 @@ type authInfo struct {
UID uint64 `json:"uid"`
RoomId types.RoomId `json:"roomid"`
ProtoVer int `json:"protover"`
+ BUVID3 string `json:"buvid"`
Platform string `json:"platform"`
Type int `json:"type"`
Key string `json:"key"`
}
// NewAuth creates a new authentication exchange.
-func NewAuth(protocol ProtocolVer, roomId types.RoomId, authKey string) (exc DanmakuExchange) {
+func NewAuth(protocol ProtocolVer, roomId types.RoomId, authKey, buvid3 string) (exc DanmakuExchange) {
exc, _ = NewPlainExchange(OpConnect, authInfo{
UID: UidGuest,
RoomId: roomId,
ProtoVer: int(protocol),
+ BUVID3: buvid3,
Platform: PlatformWeb,
Type: AuthTypeDefault,
Key: authKey,
diff --git a/danmaku/dmpkg/raw.go b/danmaku/dmpkg/raw.go
index 34cd2e6..6de10d7 100644
--- a/danmaku/dmpkg/raw.go
+++ b/danmaku/dmpkg/raw.go
@@ -37,7 +37,7 @@ func NewPlainExchange(operation Operation, body interface{}) (exc DanmakuExchang
DanmakuExchangeHeader: DanmakuExchangeHeader{
Length: uint32(length),
HeaderLength: HeaderLength,
- ProtocolVer: ProtoPlainJson,
+ ProtocolVer: ProtoMinimal,
Operation: operation,
SequenceId: SequenceId,
},