From: qydysky <32743305+qydysky@users.noreply.github.com> Date: Sat, 11 Feb 2023 13:11:41 +0000 (+0800) Subject: Add ws消息 超管切断直播 X-Git-Tag: v0.6.2~23 X-Git-Url: http://127.0.0.1:8081/?a=commitdiff_plain;h=033318abf03bed0b8cad6f8400d30c432718ac90;p=bili_danmu%2F.git Add ws消息 超管切断直播 --- diff --git a/Reply/Msg.go b/Reply/Msg.go index 6ee86a0..0a020a0 100644 --- a/Reply/Msg.go +++ b/Reply/Msg.go @@ -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, // 超管切直播 } // 屏蔽不需要的消息 diff --git a/Reply/Reply.go b/Reply/Reply.go index da3f502..b206024 100644 --- a/Reply/Reply.go +++ b/Reply/Reply.go @@ -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 index 0000000..89f3964 --- /dev/null +++ b/Reply/ws_msg/CUT_OFF.go @@ -0,0 +1,7 @@ +package part + +type CUT_OFF struct { + Cmd string `json:"cmd"` + Msg string `json:"msg"` + Roomid int `json:"roomid"` +}