mirror of
https://github.com/AynaLivePlayer/blivedm-go.git
synced 2025-12-06 11:22:50 +08:00
🐛 fix #5
This commit is contained in:
@@ -141,7 +141,7 @@ func (c *Client) sendEnterPacket() error {
|
||||
if err != nil {
|
||||
return errors.New("error roomID")
|
||||
}
|
||||
pkt := packet.NewEnterPacket(0, rid)
|
||||
pkt := packet.NewEnterPacket(0, rid, c.token)
|
||||
if err = c.conn.WriteMessage(websocket.BinaryMessage, pkt); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -11,21 +11,21 @@ type Enter struct {
|
||||
ProtoVer int `json:"protover"`
|
||||
Platform string `json:"platform"`
|
||||
ClientVer string `json:"clientver"`
|
||||
//Type int `json:"type"`
|
||||
//Key string `json:"key"`
|
||||
Type int `json:"type"`
|
||||
Key string `json:"key"`
|
||||
}
|
||||
|
||||
// NewEnterPacket 构造进入房间的包
|
||||
// uid可以为0,key不需要
|
||||
func NewEnterPacket(uid int, roomID int) []byte {
|
||||
func NewEnterPacket(uid int, roomID int, key string) []byte {
|
||||
ent := &Enter{
|
||||
UID: uid,
|
||||
RoomID: roomID,
|
||||
ProtoVer: 1,
|
||||
ProtoVer: 2,
|
||||
Platform: "web",
|
||||
ClientVer: "1.6.3",
|
||||
//Type: 2,
|
||||
//Key: key,
|
||||
ClientVer: "1.14.3",
|
||||
Type: 2,
|
||||
Key: key,
|
||||
}
|
||||
pkt := NewPlainPacket(RoomEnter, ent.Json())
|
||||
upkt := pkt.Build()
|
||||
|
||||
Reference in New Issue
Block a user