//Msg类型数据处理方法map
var Msg_map = map[string]func(replyF, string) {
+ `VOICE_JOIN_ROOM_COUNT_INFO`:replyF.voice_join_room_count_info,//连麦等待
+ `VOICE_JOIN_LIST`:nil,
+ `VOICE_JOIN_STATUS`:replyF.voice_join_status,//连麦人状态
`STOP_LIVE_ROOM_LIST`:nil,//停止直播的直播间
`PK_LOTTERY_START`:replyF.pk_lottery_start,//大乱斗pk
`PK_BATTLE_PRE_NEW`:nil,//pk准备
return
}
Gui_show(j.Data.Title,`0room`)
- msglog.L(`I`, j.Data.Title)
+ msglog.L(`I: `, j.Data.Title)
+}
+
+//连麦人状态
+func (replyF) voice_join_status(s string){
+ msglog := msglog.Base_add("连麦")
+ var j ws_msg.VOICE_JOIN_STATUS
+ if e := json.Unmarshal([]byte(s), &j);e != nil{
+ msglog.L(`E: `, e)
+ return
+ }
+ if j.Data.UserName == `` {return}
+
+ Gui_show(`连麦中:`+j.Data.UserName,`0room`)
+ msglog.L(`I: `, `连麦中:`, j.Data.UserName)
+}
+
+//连麦等待
+func (replyF) voice_join_room_count_info(s string){
+ msglog := msglog.Base_add("连麦")
+ var j ws_msg.VOICE_JOIN_ROOM_COUNT_INFO
+ if e := json.Unmarshal([]byte(s), &j);e != nil{
+ msglog.L(`E: `, e)
+ return
+ }
+ Gui_show(`连麦等待:`+strconv.Itoa(j.Data.ApplyCount),`0room`)
+ msglog.L(`I: `, `连麦等待人数`, j.Data.ApplyCount)
}
//大乱斗pk状态
}
if diff := j.Data.InitInfo.Votes-j.Data.MatchInfo.Votes;diff<0 {
Gui_show(`大乱斗落后`,strconv.Itoa(diff),`0room`)
- msglog.L(`I`, `大乱斗落后`,diff)
+ msglog.L(`I: `, `大乱斗落后`,diff)
}
}
})
}
Gui_show(j.Data.InteractMsg,`0room`)
- msglog.L(`I`, j.Data.InteractMsg)
+ msglog.L(`I: `, j.Data.InteractMsg)
}
//msg-直播间进入信息,此处用来提示关注
//Msg-热门榜变动
func (replyF) hot_rank_changed(s string){
- msglog := msglog.Base_add("房")
+ msglog := msglog.Base_add("房").Log_show_control(false)
var type_item ws_msg.HOT_RANK_CHANGED
if e := json.Unmarshal([]byte(s), &type_item);e != nil {
} else {
c.Note += strconv.Itoa(type_item.Data.Rank)
}
+ fmt.Printf("%s\t%s\n", "热门榜", c.Note)
msglog.L(`I: `, "热门榜", c.Note)
}
}
--- /dev/null
+package part
+
+type VOICE_JOIN_LIST struct {
+ Cmd string `json:"cmd"`
+ Data struct {
+ RoomID int `json:"room_id"`
+ Category int `json:"category"`
+ ApplyCount int `json:"apply_count"`
+ RedPoint int `json:"red_point"`
+ Refresh int `json:"refresh"`
+ } `json:"data"`
+ Roomid int `json:"roomid"`
+}
+//{"cmd":"VOICE_JOIN_LIST","data":{"room_id":1017,"category":1,"apply_count":62,"red_point":1,"refresh":0},"roomid":1017}
\ No newline at end of file
--- /dev/null
+package part
+
+type VOICE_JOIN_ROOM_COUNT_INFO struct {
+ Cmd string `json:"cmd"`
+ Data struct {
+ RoomID int `json:"room_id"`
+ RootStatus int `json:"root_status"`
+ RoomStatus int `json:"room_status"`
+ ApplyCount int `json:"apply_count"`
+ NotifyCount int `json:"notify_count"`
+ RedPoint int `json:"red_point"`
+ } `json:"data"`
+ Roomid int `json:"roomid"`
+}
+//{"cmd":"VOICE_JOIN_ROOM_COUNT_INFO","data":{"room_id":1017,"root_status":1,"room_status":1,"apply_count":62,"notify_count":0,"red_point":0},"roomid":1017}
\ No newline at end of file
--- /dev/null
+package part
+
+type VOICE_JOIN_STATUS struct {
+ Cmd string `json:"cmd"`
+ Data struct {
+ RoomID int `json:"room_id"`
+ Status int `json:"status"`
+ Channel string `json:"channel"`
+ ChannelType string `json:"channel_type"`
+ UID int `json:"uid"`
+ UserName string `json:"user_name"`
+ HeadPic string `json:"head_pic"`
+ Guard int `json:"guard"`
+ StartAt int `json:"start_at"`
+ CurrentTime int `json:"current_time"`
+ WebShareLink string `json:"web_share_link"`
+ } `json:"data"`
+ Roomid int `json:"roomid"`
+}
+//{"cmd":"VOICE_JOIN_STATUS","data":{"room_id":1017,"status":0,"channel":"","channel_type":"voice","uid":0,"user_name":"","head_pic":"","guard":0,"start_at":0,"current_time":1621702198,"web_share_link":"https:\/\/live.bilibili.com\/h5\/1017"},"roomid":1017}
\ No newline at end of file
"?":"问号",
"?":"问号",
"!":"叹号",
- "!":"叹号"
+ "!":"叹号",
+ "hso":"好色哦"
}
}
\ No newline at end of file