You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
package msg_handler
|
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
)
|
|
|
|
|
|
|
|
type InterActWord struct {
|
|
|
|
Contribution struct {
|
|
|
|
Grade int `json:"grade"` // 贡献等级
|
|
|
|
} `json:"contribution"` // 贡献
|
|
|
|
|
|
|
|
DMScore int `json:"dmscore"` // 等级
|
|
|
|
|
|
|
|
FansMedal *FansMedal `json:"fans_medal"` // 佩戴粉丝勋章
|
|
|
|
|
|
|
|
Identities []int `json:"identities"` // 啥玩意儿???
|
|
|
|
IsSpread int `json:"isSpread"` // ???
|
|
|
|
MsgType int `json:"msg_type"` // ???
|
|
|
|
RoomId int `json:"room_id"` // 房间号
|
|
|
|
Score int `json:"score"` // ???
|
|
|
|
SpreadDesc string `json:"spread_desc"` // ???
|
|
|
|
SpreadInfo string `json:"spread_info"` // ???
|
|
|
|
TailIcon int `json:"tail_icon"` // ???
|
|
|
|
Timestamp int `json:"timestamp"` // 进场时间
|
|
|
|
TriggerTime int `json:"trigger_time"` // 触发时间,触发什么呢???
|
|
|
|
Uid int `json:"uid"` // 用户ID
|
|
|
|
Uname string `json:"uname"` // 用户名
|
|
|
|
UnameColor string `json:"uname_color"` // 用户名颜色
|
|
|
|
}
|
|
|
|
|
|
|
|
type InterActWordHandler struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
func (h *InterActWordHandler) CMD() string {
|
|
|
|
return "INTERACT_WORD"
|
|
|
|
}
|
|
|
|
|
|
|
|
func (h *InterActWordHandler) HandlerMessage(data []byte) {
|
|
|
|
var baseMsg struct {
|
|
|
|
CMD string `json:"cmd"`
|
|
|
|
Data *InterActWord `json:"data"`
|
|
|
|
}
|
|
|
|
if err := json.Unmarshal(data, &baseMsg); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
//logger.SLog.Debugf("%s进入直播间", baseMsg.Data.Uname)
|
|
|
|
}
|