]> 127.0.0.1 Git - bili_danmu/.git/commitdiff
连麦显示
authorqydysky <qydysky@foxmail.com>
Sat, 22 May 2021 17:31:14 +0000 (01:31 +0800)
committerqydysky <qydysky@foxmail.com>
Sat, 22 May 2021 17:31:14 +0000 (01:31 +0800)
Reply/Msg.go
Reply/Reply.go
Reply/ws_msg/VOICE_JOIN_LIST.go [new file with mode: 0644]
Reply/ws_msg/VOICE_JOIN_ROOM_COUNT_INFO.go [new file with mode: 0644]
Reply/ws_msg/VOICE_JOIN_STATUS.go [new file with mode: 0644]
demo/config/config_tts.json

index 86ee3d053e70803a4df7f88cfdc4d26f499f7137..ddc41a104f0c8608b4761c2f88c08de2e1180a86 100644 (file)
@@ -14,6 +14,9 @@ var msglog = c.Log.Base(`Msg`)
 
 //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准备
index 7a9026978af5cd912d307b14fc2b8e7ea141f275..cb08b67e57133f8fab4aa4cf82770d29e48ee29e 100644 (file)
@@ -75,7 +75,33 @@ func (replyF) pk_lottery_start(s string){
                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状态
@@ -88,7 +114,7 @@ func (replyF) pk_battle_process_new(s string){
        }
        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)
        }
 }
 
@@ -107,7 +133,7 @@ func (replyF) vtr_gift_lottery(s string){
                })
        }
        Gui_show(j.Data.InteractMsg,`0room`)
-       msglog.L(`I`, j.Data.InteractMsg)
+       msglog.L(`I`, j.Data.InteractMsg)
 }
 
 //msg-直播间进入信息,此处用来提示关注
@@ -619,7 +645,7 @@ func (replyF) panel(s string){
 
 //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 {
@@ -632,6 +658,7 @@ func (replyF) hot_rank_changed(s string){
                } else {
                        c.Note += strconv.Itoa(type_item.Data.Rank)
                }
+               fmt.Printf("%s\t%s\n", "热门榜", c.Note)
                msglog.L(`I: `, "热门榜", c.Note)
        }
 }
diff --git a/Reply/ws_msg/VOICE_JOIN_LIST.go b/Reply/ws_msg/VOICE_JOIN_LIST.go
new file mode 100644 (file)
index 0000000..c5c2ce8
--- /dev/null
@@ -0,0 +1,14 @@
+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
diff --git a/Reply/ws_msg/VOICE_JOIN_ROOM_COUNT_INFO.go b/Reply/ws_msg/VOICE_JOIN_ROOM_COUNT_INFO.go
new file mode 100644 (file)
index 0000000..db42a3b
--- /dev/null
@@ -0,0 +1,15 @@
+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
diff --git a/Reply/ws_msg/VOICE_JOIN_STATUS.go b/Reply/ws_msg/VOICE_JOIN_STATUS.go
new file mode 100644 (file)
index 0000000..7aa03b6
--- /dev/null
@@ -0,0 +1,20 @@
+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
index e4b1f868b04ca94faf7175062a3b6026aaa53cb6..a167e5a18c797c6dede3d4036d54a4f70b98bf78 100644 (file)
@@ -14,6 +14,7 @@
         "?":"问号",
         "?":"问号",
         "!":"叹号",
-        "!":"叹号"
+        "!":"叹号",
+        "hso":"好色哦"
     }
 }
\ No newline at end of file