"LIVE": replyF.live, //开播
"SUPER_CHAT_ENTRANCE": nil, //SC入口
"SUPER_CHAT_MESSAGE_DELETE": nil, //SC删除
- "SUPER_CHAT_MESSAGE": nil, //replyF.super_chat_message,//SC
- "SUPER_CHAT_MESSAGE_JPN": replyF.super_chat_message, //SC
+ "SUPER_CHAT_MESSAGE": replyF.super_chat_message, //SC
+ "SUPER_CHAT_MESSAGE_JPN": nil, //replyF.super_chat_message, //SC
"PANEL": nil, //replyF.panel,//排行榜 被HOT_RANK_CHANGED替代
"ENTRY_EFFECT": replyF.entry_effect, //进入特效
"ROOM_REAL_TIME_MESSAGE_UPDATE": nil, //replyF.roominfo,//粉丝数
}
// Msg-超级留言处理
-var sc_buf = make(map[string]struct{})
+var sc_buf = make(map[int]struct{})
func (replyF) super_chat_message(s string) {
msglog := msglog.Base_add("礼")
- var j ws_msg.SUPER_CHAT_MESSAGE_JPN
+ var j ws_msg.SUPER_CHAT_MESSAGE
if e := json.Unmarshal([]byte(s), &j); e != nil {
msglog.L(`E: `, e)
}
id := j.Data.ID
- if id != "" {
+ if id != 0 {
if _, ok := sc_buf[id]; ok {
return
}
break
}
{ //copy map
- tmp := make(map[string]struct{})
+ tmp := make(map[int]struct{})
for k, v := range sc_buf {
tmp[k] = v
}
uname := j.Data.UserInfo.Uname
price := j.Data.Price
message := j.Data.Message
- message_jpn := j.Data.MessageJpn
var sh = []interface{}{"SC: "}
c.C.Danmu_Main_mq.Push_tag(`tts`, Danmu_mq_t{ //传入消息队列
uid: `0superchat`,
m: map[string]string{
- `{uname}`: uname,
- `{price}`: strconv.Itoa(price),
- `{message}`: message,
- `{message_jpn}`: message_jpn,
+ `{uname}`: uname,
+ `{price}`: strconv.Itoa(price),
+ `{message}`: message,
},
})
}
- if message != message_jpn && message_jpn != "" {
- fmt.Println(message_jpn)
- // Gui_show(message_jpn.(string))
- sh = append(sh, message_jpn)
- logg = append(logg, message_jpn)
+ if message != "" {
+ fmt.Println(message)
+ sh = append(sh, message)
+ logg = append(logg, message)
}
fmt.Print("====\n")
{ //额外
Assf(fmt.Sprintln(sh...))
- // Gui_show("====\n")
Gui_show(Itos(sh), "0superchat")
//直播流服务弹幕
SendStreamWs(Danmu_item{
--- /dev/null
+package part
+
+type SUPER_CHAT_MESSAGE struct {
+ Cmd string `json:"cmd"`
+ Data struct {
+ BackgroundBottomColor string `json:"background_bottom_color"`
+ BackgroundColor string `json:"background_color"`
+ BackgroundColorEnd string `json:"background_color_end"`
+ BackgroundColorStart string `json:"background_color_start"`
+ BackgroundIcon string `json:"background_icon"`
+ BackgroundImage string `json:"background_image"`
+ BackgroundPriceColor string `json:"background_price_color"`
+ ColorPoint float64 `json:"color_point"`
+ Dmscore int `json:"dmscore"`
+ EndTime int `json:"end_time"`
+ Gift struct {
+ GiftID int `json:"gift_id"`
+ GiftName string `json:"gift_name"`
+ Num int `json:"num"`
+ } `json:"gift"`
+ ID int `json:"id"`
+ IsRanked int `json:"is_ranked"`
+ IsSendAudit int `json:"is_send_audit"`
+ MedalInfo struct {
+ AnchorRoomid int `json:"anchor_roomid"`
+ AnchorUname string `json:"anchor_uname"`
+ GuardLevel int `json:"guard_level"`
+ IconID int `json:"icon_id"`
+ IsLighted int `json:"is_lighted"`
+ MedalColor string `json:"medal_color"`
+ MedalColorBorder int `json:"medal_color_border"`
+ MedalColorEnd int `json:"medal_color_end"`
+ MedalColorStart int `json:"medal_color_start"`
+ MedalLevel int `json:"medal_level"`
+ MedalName string `json:"medal_name"`
+ Special string `json:"special"`
+ TargetID int `json:"target_id"`
+ } `json:"medal_info"`
+ Message string `json:"message"`
+ MessageFontColor string `json:"message_font_color"`
+ MessageTrans string `json:"message_trans"`
+ Price int `json:"price"`
+ Rate int `json:"rate"`
+ StartTime int `json:"start_time"`
+ Time int `json:"time"`
+ Token string `json:"token"`
+ TransMark int `json:"trans_mark"`
+ Ts int `json:"ts"`
+ UID int `json:"uid"`
+ UserInfo struct {
+ Face string `json:"face"`
+ FaceFrame string `json:"face_frame"`
+ GuardLevel int `json:"guard_level"`
+ IsMainVip int `json:"is_main_vip"`
+ IsSvip int `json:"is_svip"`
+ IsVip int `json:"is_vip"`
+ LevelColor string `json:"level_color"`
+ Manager int `json:"manager"`
+ NameColor string `json:"name_color"`
+ Title string `json:"title"`
+ Uname string `json:"uname"`
+ UserLevel int `json:"user_level"`
+ } `json:"user_info"`
+ } `json:"data"`
+ Roomid int `json:"roomid"`
+}