//Msg类型数据处理方法map
var Msg_map = map[string]func(replyF, string) {
`HOT_RANK_SETTLEMENT`:nil,
- `HOT_RANK_CHANGED`:nil,
+ `HOT_RANK_CHANGED`:replyF.hot_rank_changed,//热门榜变动
`CARD_MSG`:nil,//提示关注
`LIVE_INTERACTIVE_GAME`:nil,
`WIDGET_BANNER`:nil,//每日任务
"SUPER_CHAT_MESSAGE_DELETE":nil,//SC删除
"SUPER_CHAT_MESSAGE":nil,//replyF.super_chat_message,//SC
"SUPER_CHAT_MESSAGE_JPN":replyF.super_chat_message,//SC
- "PANEL":replyF.panel,//排行榜
+ "PANEL":nil,//replyF.panel,//排行榜 被HOT_RANK_CHANGED替代
"ENTRY_EFFECT":nil,//replyF.entry_effect,//进入特效
"ROOM_REAL_TIME_MESSAGE_UPDATE":nil,//replyF.roominfo,//粉丝数
}
"bytes"
"strconv"
"compress/zlib"
+ "encoding/json"
p "github.com/qydysky/part"
mq "github.com/qydysky/part/msgq"
F "github.com/qydysky/bili_danmu/F"
+ ws_msg "github.com/qydysky/bili_danmu/Reply/ws_msg"
send "github.com/qydysky/bili_danmu/Send"
c "github.com/qydysky/bili_danmu/CV"
)
msglog.Base_add("礼").Log_show_control(false).L(`I: `, logg...)
}
-//Msg-分区排行
+//Msg-分区排行 使用热门榜替代
func (replyF) panel(s string){
msglog := msglog.Base_add("房").Log_show_control(false)
}
}
+//Msg-热门榜变动
+func (replyF) hot_rank_changed(s string){
+ 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 {
+ msglog.L(`E: `, e)
+ }
+ if type_item.Data.Area_name != `` {
+ c.Note = type_item.Data.Area_name + " "
+ if type_item.Data.Rank == 0 {
+ c.Note += "50+"
+ } else {
+ c.Note += strconv.Itoa(type_item.Data.Rank)
+ }
+ fmt.Println("热门榜", c.Note)
+ msglog.L(`I: `, "热门榜", c.Note)
+ }
+}
+
//Msg-进入特效,大多为大航海进入,信息少,使用welcome_guard替代
func (replyF) entry_effect(s string){
msglog := msglog.Base_add("房").Log_show_control(false)
--- /dev/null
+package part
+
+type HOT_RANK_CHANGED struct {
+ Cmd string `json:"cmd"`
+ Data struct {
+ Rank int `json:"rank"`
+ Trend int `json:"trend"`
+ Countdown string `json:"countdown"`
+ Timestamp string `json:"timestamp"`
+ Web_url string `json:"web_url"`
+ Live_url string `json:"live_url"`
+ Blink_url string `json:"blink_url"`
+ Live_link_url string `json:"live_link_url"`
+ Pc_link_url string `json:"pc_link_url"`
+ Icon string `json:"icon"`
+ Area_name string `json:"area_name"`
+ } `json:"data"`
+}