]> 127.0.0.1 Git - bili_danmu/.git/commitdiff
Add ws消息 超管切断直播
authorqydysky <32743305+qydysky@users.noreply.github.com>
Sat, 11 Feb 2023 13:11:41 +0000 (21:11 +0800)
committerqydysky <32743305+qydysky@users.noreply.github.com>
Sat, 11 Feb 2023 13:11:41 +0000 (21:11 +0800)
Reply/Msg.go
Reply/Reply.go
Reply/ws_msg/CUT_OFF.go [new file with mode: 0644]

index 6ee86a06e03519e83f676da0b5a3fa7a56ed39b1..0a020a0d23534a88660e04e6739a95dbe9722cec 100644 (file)
@@ -119,6 +119,7 @@ var Msg_map = map[string]func(replyF, string){
        "GIFT_STAR_PROCESS":                 nil,
        "RECOMMEND_CARD":                    nil, //主播商品营销
        "GOTO_BUY_FLOW":                     nil,
+       "CUT_OFF":                           replyF.cut_off, // 超管切直播
 }
 
 // 屏蔽不需要的消息
index da3f502c493e6459bb92c2d962d11036e7bdc82e..b206024c0af4d470e9694cc82cf2a7495e74a5de 100644 (file)
@@ -87,6 +87,28 @@ func (replyF) defaultMsg(s string) {
        msglog.Base_add("Unknow").L(`E: `, s)
 }
 
+// 超管切直播
+func (replyF) cut_off(s string) {
+       msglog := msglog.Base_add("超管切直播")
+       var j ws_msg.CUT_OFF
+       if e := json.Unmarshal([]byte(s), &j); e != nil {
+               msglog.L(`E: `, e)
+               return
+       }
+
+       j.Msg = fmt.Sprint(j.Msg)
+
+       //直播流服务弹幕
+       SendStreamWs(Danmu_item{
+               auth:   "超管",
+               border: true,
+               color:  "#FF0000",
+               msg:    j.Msg,
+       })
+       Gui_show(j.Msg, `0room`)
+       msglog.L(`I: `, "超管切断了直播,理由:"+j.Msg)
+}
+
 // 大乱斗pk开始
 func (replyF) pk_lottery_start(s string) {
        msglog := msglog.Base_add("大乱斗")
diff --git a/Reply/ws_msg/CUT_OFF.go b/Reply/ws_msg/CUT_OFF.go
new file mode 100644 (file)
index 0000000..89f3964
--- /dev/null
@@ -0,0 +1,7 @@
+package part
+
+type CUT_OFF struct {
+       Cmd    string `json:"cmd"`
+       Msg    string `json:"msg"`
+       Roomid int    `json:"roomid"`
+}