feat: 粉丝勋章,同步协议,优化解析。

main
NorthLan 2 years ago
parent 76008c7098
commit 1a78ca7567

@ -116,7 +116,7 @@ func (l *LiveBilibili) preConnect() (url string, err error) {
msg_handler.NewDanmakuHandler(l.roomInfo.RoomId), msg_handler.NewDanmakuHandler(l.roomInfo.RoomId),
msg_handler.NewSendGiftHandler(l.roomInfo.RoomId), msg_handler.NewSendGiftHandler(l.roomInfo.RoomId),
msg_handler.NewGuardBuyHandler(l.roomInfo.RoomId), msg_handler.NewGuardBuyHandler(l.roomInfo.RoomId),
//&msg_handler.InterActWordHandler{}, msg_handler.NewRedPocketHandler(l.roomInfo.RoomId),
) )
} }
return return

@ -3,20 +3,21 @@ package msg_handler
// FansMedal 粉丝勋章 // FansMedal 粉丝勋章
// TODO 完善粉丝勋章解析,后边带?的是未知的 // TODO 完善粉丝勋章解析,后边带?的是未知的
type FansMedal struct { type FansMedal struct {
AnchorRoomId int `json:"anchor_roomid"` // 佩戴勋章所指的直播间ID AnchorRoomId int64 `json:"anchor_roomid"` // 佩戴勋章所指的直播间ID
GuardLevel int `json:"guard_level"` // 舰队等级 AnchorUname string `json:"anchor_uname"` // 佩戴勋章所指的UP主名称
IconId int `json:"icon_id"` // 图标ID??? GuardLevel int64 `json:"guard_level"` // 舰队等级
IsLighted int `json:"is_lighted"` // ??? IconId int64 `json:"icon_id"` // 图标ID???
IsLighted int64 `json:"is_lighted"` // ???
MedalColor int `json:"medal_color"` // 勋章颜色 MedalColor int64 `json:"medal_color"` // 勋章颜色
MedalColorBorder int `json:"medal_color_border"` // 勋章边框颜色 MedalColorBorder int64 `json:"medal_color_border"` // 勋章边框颜色
MedalColorEnd int `json:"medal_color_end"` // 渐变勋章结束颜色 MedalColorEnd int64 `json:"medal_color_end"` // 渐变勋章结束颜色
MedalColorStart int `json:"medal_color_start"` // 渐变勋章开始颜色 MedalColorStart int64 `json:"medal_color_start"` // 渐变勋章开始颜色
MedalLevel int `json:"medal_level"` // 勋章等级 MedalLevel int64 `json:"medal_level"` // 勋章等级
MedalName string `json:"medal_name"` // 勋章名 MedalName string `json:"medal_name"` // 勋章名
Score int `json:"score"` // ??? Score int64 `json:"score"` // ???
Special string `json:"special"` // ??? Special string `json:"special"` // ???
TargetId int `json:"target_id"` // 佩戴勋章所指的主播ID TargetId int64 `json:"target_id"` // 佩戴勋章所指的主播ID
} }
const ( const (

@ -5,7 +5,8 @@ import (
"git.noahlan.cn/northlan/ntools-go/kafka" "git.noahlan.cn/northlan/ntools-go/kafka"
"git.noahlan.cn/northlan/ntools-go/logger" "git.noahlan.cn/northlan/ntools-go/logger"
"live-gateway/config" "live-gateway/config"
"live-gateway/pb" "live-gateway/pb/mq"
pbVars "live-gateway/pb/vars"
kfk "live-gateway/pkg/kafka" kfk "live-gateway/pkg/kafka"
"strconv" "strconv"
) )
@ -33,10 +34,9 @@ type Danmaku struct {
MobileVerify bool `json:"mobile_verify"` // 是否验证手机号 MobileVerify bool `json:"mobile_verify"` // 是否验证手机号
UnameColor string `json:"uname_color"` // 用户名颜色 UnameColor string `json:"uname_color"` // 用户名颜色
MedalLevel int `json:"medal_level"` // 粉丝勋章等级 FansMedal
MedalName string `json:"medal_name"` // 勋章名
MedalUpName string `json:"medal_up_name"` // up主名称 UserLevel int64 `json:"user_level"` // 用户UL等级
UserLevel int `json:"user_level"` // 用户等级
} }
type DanmakuHandler struct { type DanmakuHandler struct {
@ -65,7 +65,7 @@ func (d *DanmakuHandler) HandlerMessage(data []byte) {
return return
} }
dm := &Danmaku{} dm := &Danmaku{FansMedal: FansMedal{}}
info := baseMsg.Info info := baseMsg.Info
l := len(info) l := len(info)
@ -98,28 +98,40 @@ func (d *DanmakuHandler) HandlerMessage(data []byte) {
h := info[3].([]interface{}) h := info[3].([]interface{})
l2 := len(h) l2 := len(h)
if l2 >= 1 { if l2 >= 1 {
dm.MedalLevel = int(h[0].(float64)) dm.FansMedal.MedalLevel = int64(h[0].(float64))
} }
if l2 >= 2 { if l2 >= 2 {
dm.MedalName = h[1].(string) dm.FansMedal.MedalName = h[1].(string)
} }
if l2 >= 3 { if l2 >= 3 {
dm.MedalUpName = h[2].(string) dm.FansMedal.AnchorUname = h[2].(string)
}
if l2 >= 4 {
dm.FansMedal.AnchorRoomId = int64(h[3].(float64))
}
if l2 >= 5 {
dm.FansMedal.TargetId = int64(h[4].(float64))
} }
} }
if l >= 5 { if l >= 5 {
h := info[4].([]interface{}) h := info[4].([]interface{})
dm.UserLevel = int(h[0].(float64)) dm.UserLevel = int64(h[0].(float64))
} }
logger.SLog.Debugf("%s 说: %s", dm.Uname, dm.Content) logger.SLog.Debugf("%s 说: %s", dm.Uname, dm.Content)
dmMsg := &pbMq.MqDanmaku{ dmMsg := &pbMq.MqDanmaku{
Platform: pbMq.Platform_name[int32(pbMq.Platform_bilibili)], Platform: pbVars.Platform_name[int32(pbVars.Platform_Bilibili)],
LiveRoomId: d.liveRoomId, LiveRoomId: d.liveRoomId,
Uid: dm.UID, Uid: dm.UID,
Uname: dm.Uname, Uname: dm.Uname,
Avatar: "",
Msg: dm.Content, Msg: dm.Content,
MsgId: "",
Timestamp: dm.SendTime, Timestamp: dm.SendTime,
FansMedalWearingStatus: dm.FansMedal.AnchorRoomId == d.liveRoomId,
FansMedalName: dm.FansMedal.MedalName,
FansMedalLevel: dm.FansMedal.MedalLevel,
} }
_ = d.producer.SendMessageAsync(dmMsg, strconv.FormatInt(dm.UID, 10)) _ = d.producer.SendMessageAsync(dmMsg, strconv.FormatInt(dm.UID, 10))

@ -5,7 +5,8 @@ import (
"git.noahlan.cn/northlan/ntools-go/kafka" "git.noahlan.cn/northlan/ntools-go/kafka"
"git.noahlan.cn/northlan/ntools-go/logger" "git.noahlan.cn/northlan/ntools-go/logger"
"live-gateway/config" "live-gateway/config"
pbMq "live-gateway/pb" pbMq "live-gateway/pb/mq"
pbVars "live-gateway/pb/vars"
kfk "live-gateway/pkg/kafka" kfk "live-gateway/pkg/kafka"
"strconv" "strconv"
) )
@ -59,7 +60,7 @@ func (d *DanmakuOfficialHandler) HandlerMessage(data []byte) {
logger.SLog.Debugf("%+v", dm) logger.SLog.Debugf("%+v", dm)
dmMsg := &pbMq.MqDanmaku{ dmMsg := &pbMq.MqDanmaku{
Platform: pbMq.Platform_name[int32(pbMq.Platform_bilibili)], Platform: pbVars.Platform_name[int32(pbVars.Platform_Bilibili)],
LiveRoomId: d.liveRoomId, LiveRoomId: d.liveRoomId,
Uid: dm.UID, Uid: dm.UID,
Uname: dm.Uname, Uname: dm.Uname,

@ -4,7 +4,8 @@ import (
"encoding/json" "encoding/json"
"git.noahlan.cn/northlan/ntools-go/kafka" "git.noahlan.cn/northlan/ntools-go/kafka"
"live-gateway/config" "live-gateway/config"
"live-gateway/pb" "live-gateway/pb/mq"
pbVars "live-gateway/pb/vars"
kfk "live-gateway/pkg/kafka" kfk "live-gateway/pkg/kafka"
"strconv" "strconv"
) )
@ -66,7 +67,7 @@ func (h *GiftOfficialHandler) HandlerMessage(data []byte) {
gift := baseMsg.Data gift := baseMsg.Data
dmMsg := &pbMq.MqGift{ dmMsg := &pbMq.MqGift{
Platform: pbMq.Platform_name[int32(pbMq.Platform_bilibili)], Platform: pbVars.Platform_name[int32(pbVars.Platform_Bilibili)],
LiveRoomId: h.liveRoomId, LiveRoomId: h.liveRoomId,
Uid: gift.Uid, Uid: gift.Uid,
Uname: gift.Uname, Uname: gift.Uname,

@ -5,7 +5,8 @@ import (
"git.noahlan.cn/northlan/ntools-go/kafka" "git.noahlan.cn/northlan/ntools-go/kafka"
"git.noahlan.cn/northlan/ntools-go/logger" "git.noahlan.cn/northlan/ntools-go/logger"
"live-gateway/config" "live-gateway/config"
"live-gateway/pb" "live-gateway/pb/mq"
pbVars "live-gateway/pb/vars"
kfk "live-gateway/pkg/kafka" kfk "live-gateway/pkg/kafka"
"strconv" "strconv"
) )
@ -51,7 +52,7 @@ func (h *GuardBuyHandler) HandlerMessage(data []byte) {
logger.SLog.Infof("%s 购买 %s x %d", baseMsg.Data.Uname, baseMsg.Data.GiftName, baseMsg.Data.Num) logger.SLog.Infof("%s 购买 %s x %d", baseMsg.Data.Uname, baseMsg.Data.GiftName, baseMsg.Data.Num)
dmMsg := &pbMq.MqNobilityBuy{ dmMsg := &pbMq.MqNobilityBuy{
Platform: pbMq.Platform_name[int32(pbMq.Platform_bilibili)], Platform: pbVars.Platform_name[int32(pbVars.Platform_Bilibili)],
LiveRoomId: h.liveRoomId, LiveRoomId: h.liveRoomId,
Uid: baseMsg.Data.Uid, Uid: baseMsg.Data.Uid,
Uname: baseMsg.Data.Uname, Uname: baseMsg.Data.Uname,

@ -6,7 +6,8 @@ import (
"git.noahlan.cn/northlan/ntools-go/logger" "git.noahlan.cn/northlan/ntools-go/logger"
"github.com/jinzhu/now" "github.com/jinzhu/now"
"live-gateway/config" "live-gateway/config"
"live-gateway/pb" "live-gateway/pb/mq"
pbVars "live-gateway/pb/vars"
kfk "live-gateway/pkg/kafka" kfk "live-gateway/pkg/kafka"
"live-gateway/pkg/timex" "live-gateway/pkg/timex"
"strconv" "strconv"
@ -62,7 +63,7 @@ func (h *GuardBuyOfficialHandler) HandlerMessage(data []byte) {
logger.SLog.Infof("%s 购买 %d %d%s", d.UserInfo.Uname, d.GuardLevel, d.GuardNum, d.GuardUnit) logger.SLog.Infof("%s 购买 %d %d%s", d.UserInfo.Uname, d.GuardLevel, d.GuardNum, d.GuardUnit)
dmMsg := &pbMq.MqNobilityBuy{ dmMsg := &pbMq.MqNobilityBuy{
Platform: pbMq.Platform_name[int32(pbMq.Platform_bilibili)], Platform: pbVars.Platform_name[int32(pbVars.Platform_Bilibili)],
LiveRoomId: h.liveRoomId, LiveRoomId: h.liveRoomId,
Uid: d.UserInfo.Uid, Uid: d.UserInfo.Uid,
Uname: d.UserInfo.Uname, Uname: d.UserInfo.Uname,

@ -0,0 +1,81 @@
package msg_handler
import (
"encoding/json"
"git.noahlan.cn/northlan/ntools-go/kafka"
"live-gateway/config"
"live-gateway/pb/mq"
pbVars "live-gateway/pb/vars"
kfk "live-gateway/pkg/kafka"
"strconv"
)
type RedPocket struct {
LotId int64 `json:"lot_id"` // 本次抽奖ID
Uname string `json:"uname"` // UName
UID int64 `json:"uid"` // UID
StartTime int64 `json:"start_time"` // 红包开始时间
CurrentTime int64 `json:"current_time"` // 当前时间
WaitNum int64 `json:"wait_num"` // 不清楚???
Action string `json:"action"`
GiftName string `json:"gift_name"` // 名
GiftID int64 `json:"gift_id"` // id - 13000
Num int64 `json:"num"` // 数量
Price int64 `json:"price"` // 电池数
MedalInfo FansMedal `json:"medal_info"`
}
type RedPocketHandler struct {
producer *kafka.Producer
liveRoomId int64
}
func NewRedPocketHandler(liveRoomId int64) *RedPocketHandler {
cfg := config.Config.Kafka.Gift
return &RedPocketHandler{
producer: kafka.NewKafkaProducer(kfk.DefaultProducerConfig, cfg.Addr, cfg.Topic),
liveRoomId: liveRoomId,
}
}
func (h *RedPocketHandler) CMD() string {
return "POPULARITY_RED_POCKET_NEW"
}
func (h *RedPocketHandler) HandlerMessage(data []byte) {
var baseMsg struct {
CMD string `json:"cmd"`
Data *RedPocket `json:"data"`
}
if err := json.Unmarshal(data, &baseMsg); err != nil {
return
}
//logger.SLog.Infof("%s %s礼物 %s x%d", baseMsg.Data.Uname, baseMsg.Data.Action, baseMsg.Data.GiftName, baseMsg.Data.Num)
dmMsg := &pbMq.MqGift{
Platform: pbVars.Platform_name[int32(pbVars.Platform_Bilibili)],
LiveRoomId: h.liveRoomId,
MsgId: "",
Timestamp: baseMsg.Data.CurrentTime,
Uid: baseMsg.Data.UID,
Uname: baseMsg.Data.Uname,
Avatar: "",
GiftId: baseMsg.Data.GiftID,
GiftName: baseMsg.Data.GiftName,
GiftNum: baseMsg.Data.Num,
Price: baseMsg.Data.Price * 100, // 红包的price是电池转换为金瓜子
IsPaid: true,
Type: pbMq.MqGift_RED_PACK,
PackGift: nil,
FansMedalWearingStatus: baseMsg.Data.MedalInfo.AnchorRoomId == h.liveRoomId,
FansMedalName: baseMsg.Data.MedalInfo.MedalName,
FansMedalLevel: baseMsg.Data.MedalInfo.MedalLevel,
}
_ = h.producer.SendMessageAsync(dmMsg, strconv.FormatInt(dmMsg.Uid, 10))
}

@ -4,61 +4,72 @@ import (
"encoding/json" "encoding/json"
"git.noahlan.cn/northlan/ntools-go/kafka" "git.noahlan.cn/northlan/ntools-go/kafka"
"live-gateway/config" "live-gateway/config"
"live-gateway/pb" "live-gateway/pb/mq"
pbVars "live-gateway/pb/vars"
kfk "live-gateway/pkg/kafka" kfk "live-gateway/pkg/kafka"
"strconv" "strconv"
) )
type SendGift struct { type (
Action string `json:"action"` // 动作,投喂等 SendGift struct {
BatchComboId string `json:"batch_combo_id"` // 礼物连击ID Action string `json:"action"` // 动作,投喂等
BatchComboSend interface{} `json:"batch_combo_send"` // ??? BatchComboId string `json:"batch_combo_id"` // 礼物连击ID
BeatId string `json:"beatId"` // ??? BatchComboSend interface{} `json:"batch_combo_send"` // ???
BizSource string `json:"biz_source"` // ?? :live BeatId string `json:"beatId"` // ???
BlindGift interface{} `json:"blind_gift"` // ?? BizSource string `json:"biz_source"` // ?? :live
BroadcastId int `json:"broadcast_id"` // 广播ID ?? BlindGift *BlindGift `json:"blind_gift"` // ??
CoinType string `json:"coin_type"` // 瓜子类型, gold金瓜子 silver银瓜子(免费礼物) BroadcastId int `json:"broadcast_id"` // 广播ID ??
ComboResourcesId int `json:"combo_resources_id"` // ??? CoinType string `json:"coin_type"` // 瓜子类型, gold金瓜子 silver银瓜子(免费礼物)
ComboSend interface{} `json:"combo_send"` // ??? ComboResourcesId int `json:"combo_resources_id"` // ???
ComboStayTime int `json:"combo_stay_time"` // 连击停留时间??? 秒? ComboSend interface{} `json:"combo_send"` // ???
ComboTotalCoin int `json:"combo_total_coin"` // 连击总币数??? ComboStayTime int `json:"combo_stay_time"` // 连击停留时间??? 秒?
CritProb int `json:"crit_prob"` // ??? ComboTotalCoin int `json:"combo_total_coin"` // 连击总币数???
Demarcation int `json:"demarcation"` // ???: 1 CritProb int `json:"crit_prob"` // ???
DiscountPrice int `json:"discount_price"` // 折扣价??? Demarcation int `json:"demarcation"` // ???: 1
DMScore int `json:"dmscore"` // 活动积分普通道具为0 DiscountPrice int `json:"discount_price"` // 折扣价???
Draw int `json:"draw"` // ??? DMScore int `json:"dmscore"` // 活动积分普通道具为0
Effect int `json:"effect"` // ??? Draw int `json:"draw"` // ???
EffectBlock int `json:"effect_block"` // ??? Effect int `json:"effect"` // ???
Face string `json:"face"` // 头像? EffectBlock int `json:"effect_block"` // ???
GiftId int64 `json:"giftId"` // 礼物ID Face string `json:"face"` // 头像?
GiftName string `json:"giftName"` // 礼物名称 GiftId int64 `json:"giftId"` // 礼物ID
GiftType int `json:"giftType"` // 礼物类型 普通,弹幕,活动 GiftName string `json:"giftName"` // 礼物名称
Gold int `json:"gold"` // 用户剩余金瓜子 GiftType int `json:"giftType"` // 礼物类型 普通,弹幕,活动
GuardLevel int `json:"guard_level"` // 舰队等级 Gold int `json:"gold"` // 用户剩余金瓜子
IsFirst bool `json:"is_first"` // 是否首次投喂? GuardLevel int `json:"guard_level"` // 舰队等级
IsSpecialBatch int `json:"is_special_batch"` // ??? IsFirst bool `json:"is_first"` // 是否首次投喂?
Magnification int `json:"magnification"` // 是否放大??? IsSpecialBatch int `json:"is_special_batch"` // ???
MedalInfo *FansMedal `json:"medal_info"` // 佩戴勋章的主播信息 Magnification int `json:"magnification"` // 是否放大???
NameColor string `json:"name_color"` // 名 颜色 MedalInfo FansMedal `json:"medal_info"` // 佩戴勋章的主播信息
Num int64 `json:"num"` // 数量 NameColor string `json:"name_color"` // 名 颜色
OriginalGiftName string `json:"original_gift_name"` // 原始礼物名称??? Num int64 `json:"num"` // 数量
Price int64 `json:"price"` // 价格? 但不是电池 OriginalGiftName string `json:"original_gift_name"` // 原始礼物名称???
RCost int `json:"rcost"` // ??? Price int64 `json:"price"` // 价格? 但不是电池
Remain int `json:"remain"` // 用户道具包裹剩余数量 RCost int `json:"rcost"` // ???
Rnd string `json:"rnd"` // 随机数? Remain int `json:"remain"` // 用户道具包裹剩余数量
SendMaster interface{} `json:"send_master"` // ??? Rnd string `json:"rnd"` // 随机数?
Silver int `json:"silver"` // 用户剩余银瓜子 SendMaster interface{} `json:"send_master"` // ???
Super int `json:"super"` // ??? Silver int `json:"silver"` // 用户剩余银瓜子
SuperBatchGiftNum int `json:"super_batch_gift_num"` // ??? Super int `json:"super"` // ???
SuperGiftNum int `json:"super_gift_num"` // ??? SuperBatchGiftNum int `json:"super_batch_gift_num"` // ???
SvgaBlock int `json:"svga_block"` // ??? SuperGiftNum int `json:"super_gift_num"` // ???
TagImage string `json:"tag_image"` // ??? SvgaBlock int `json:"svga_block"` // ???
Timestamp int64 `json:"timestamp"` // 赠送时间 TagImage string `json:"tag_image"` // ???
TopList interface{} `json:"top_list"` // ??? Timestamp int64 `json:"timestamp"` // 赠送时间
TotalCoin int `json:"total_coin"` // 总值 瓜子数 TopList interface{} `json:"top_list"` // ???
Uid int `json:"uid"` // 用户ID TotalCoin int `json:"total_coin"` // 总值 瓜子数
Uname string `json:"uname"` // 用户名 Uid int64 `json:"uid"` // 用户ID
} Uname string `json:"uname"` // 用户名
}
// BlindGift 宝箱类礼物
BlindGift struct {
BlindGiftConfigId int64 `json:"blind_gift_config_id"` // id
From int64 `json:"from"` // ??
GiftAction string `json:"gift_action"` // 爆出/投喂
OriginalGiftId int64 `json:"original_gift_id"` // 原始礼物ID
OriginalGiftName string `json:"original_gift_name"` // 原始礼物名
}
)
type SendGiftHandler struct { type SendGiftHandler struct {
producer *kafka.Producer producer *kafka.Producer
@ -89,22 +100,33 @@ func (h *SendGiftHandler) HandlerMessage(data []byte) {
//logger.SLog.Infof("%s %s礼物 %s x%d", baseMsg.Data.Uname, baseMsg.Data.Action, baseMsg.Data.GiftName, baseMsg.Data.Num) //logger.SLog.Infof("%s %s礼物 %s x%d", baseMsg.Data.Uname, baseMsg.Data.Action, baseMsg.Data.GiftName, baseMsg.Data.Num)
dmMsg := &pbMq.MqGift{ dmMsg := &pbMq.MqGift{
Platform: pbMq.Platform_name[int32(pbMq.Platform_bilibili)], Platform: pbVars.Platform_name[int32(pbVars.Platform_Bilibili)],
LiveRoomId: h.liveRoomId, LiveRoomId: h.liveRoomId,
Uid: int64(baseMsg.Data.Uid), MsgId: "",
Uname: baseMsg.Data.Uname, Timestamp: baseMsg.Data.Timestamp,
Avatar: "", Uid: baseMsg.Data.Uid,
GiftId: baseMsg.Data.GiftId, Uname: baseMsg.Data.Uname,
GiftName: baseMsg.Data.GiftName, Avatar: baseMsg.Data.Face,
GiftNum: baseMsg.Data.Num, NobilityLevel: int64(baseMsg.Data.GuardLevel),
Price: baseMsg.Data.Price, GiftId: baseMsg.Data.GiftId,
IsPaid: IsPaidGift(baseMsg.Data.CoinType), GiftName: baseMsg.Data.GiftName,
MsgId: "", GiftNum: baseMsg.Data.Num,
Timestamp: baseMsg.Data.Timestamp, Price: baseMsg.Data.Price,
NobilityLevel: 0, IsPaid: IsPaidGift(baseMsg.Data.CoinType),
FansMedalWearingStatus: false, Type: pbMq.MqGift_NORMAL,
FansMedalName: "", PackGift: nil,
FansMedalLevel: 0,
FansMedalWearingStatus: baseMsg.Data.MedalInfo.AnchorRoomId == h.liveRoomId,
FansMedalName: baseMsg.Data.MedalInfo.MedalName,
FansMedalLevel: baseMsg.Data.MedalInfo.MedalLevel,
}
// type - pack
if baseMsg.Data.BlindGift != nil {
dmMsg.Type = pbMq.MqGift_PACK
dmMsg.PackGift = &pbMq.MqGift_PackGift{
GiftId: baseMsg.Data.BlindGift.OriginalGiftId,
GiftName: baseMsg.Data.BlindGift.OriginalGiftName,
}
} }
_ = h.producer.SendMessageAsync(dmMsg, strconv.FormatInt(dmMsg.Uid, 10)) _ = h.producer.SendMessageAsync(dmMsg, strconv.FormatInt(dmMsg.Uid, 10))

@ -0,0 +1,37 @@
Bilibili:
Enabled: true
Type: custom
Official:
Api: https://live-open.biliapi.com
AkId: 1rVL1YRSoii28LJ1O7KIQqqQ
AkSecret: 5USwZt2bygTIE8a2cXahZrzsdKtbxd
Custom:
Url: wss://broadcastlv.chat.bilibili.com:2245/sub
GetRoomUrl: https://api.live.bilibili.com/room/v1/Room/room_init?id=
HeartbeatInterval: 30
UserId: 111222
RoomId: 6925399
Log:
Console:
Level: debug
Format: console
File:
Enabled: true
Level: debug
Format: console
Path: ./logs
Filename: live-gateway.log
FileMaxSize: 10 # 10mb
FileMaxBackups: 30 #
MaxAge: 7 # 保留7天
Compress: true # 压缩日志
Kafka:
Danmaku:
Addr: [ "127.0.0.1:9093" ]
Topic: "danmaku-dev"
Gift:
Addr: [ "127.0.0.1:9093" ]
Topic: "gift-dev"
GuardBuy:
Addr: [ "127.0.0.1:9093" ]
Topic: "guardBuy-dev"

@ -1,6 +1,6 @@
Bilibili: Bilibili:
Enabled: true Enabled: true
Type: official Type: custom
Official: Official:
Api: https://live-open.biliapi.com Api: https://live-open.biliapi.com
AkId: 1rVL1YRSoii28LJ1O7KIQqqQ AkId: 1rVL1YRSoii28LJ1O7KIQqqQ
@ -10,15 +10,15 @@ Bilibili:
GetRoomUrl: https://api.live.bilibili.com/room/v1/Room/room_init?id= GetRoomUrl: https://api.live.bilibili.com/room/v1/Room/room_init?id=
HeartbeatInterval: 30 HeartbeatInterval: 30
UserId: 111222 UserId: 111222
RoomId: 6925399 RoomId: 8722013
Log: Log:
Console: Console:
Level: debug Level: debug
Format: console Format: console
File: File:
Enabled: true Enabled: true
Level: info Level: debug
Format: json Format: console
Path: ./logs Path: ./logs
Filename: live-gateway.log Filename: live-gateway.log
FileMaxSize: 10 # 10mb FileMaxSize: 10 # 10mb

@ -34,6 +34,7 @@ type (
Custom struct { Custom struct {
Url string // 弹幕服务器url Url string // 弹幕服务器url
} }
ResetInterval time.Duration // 重连间隔
GetRoomUrl string // 获取房间信息url GetRoomUrl string // 获取房间信息url
RoomId int64 // 待连接roomId RoomId int64 // 待连接roomId
UserId int64 // 用于连接的userId,0则随机生成 UserId int64 // 用于连接的userId,0则随机生成

@ -118,3 +118,7 @@ func (l *Live) Serve() error {
} }
} }
} }
func (l *Live) ReConnect() {
l.Nws.CloseAndReConnect()
}

@ -7,6 +7,7 @@ import (
"live-gateway/bilibili" "live-gateway/bilibili"
"live-gateway/config" "live-gateway/config"
"sync" "sync"
"time"
) )
var configFile = flag.String("f", "./config.yml", "the config file") var configFile = flag.String("f", "./config.yml", "the config file")
@ -24,14 +25,25 @@ func main() {
var wg sync.WaitGroup var wg sync.WaitGroup
if config.Config.Bilibili.Enabled { if config.Config.Bilibili.Enabled {
wg.Add(1)
bLive := bilibili.NewLiveBilibili() bLive := bilibili.NewLiveBilibili()
wg.Add(1)
go func() { go func() {
if err := bLive.Serve(); err != nil { if err := bLive.Serve(); err != nil {
logger.SLog.Error("err: ", err) logger.SLog.Error("err: ", err)
wg.Done() wg.Done()
} }
}() }()
go func() {
// timer
timer := time.NewTimer(time.Second * config.Config.Bilibili.ResetInterval)
for {
select {
case <-timer.C:
bLive.ReConnect()
}
}
}()
} }
wg.Wait() wg.Wait()
} }

@ -1 +1,5 @@
protoc --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative --go-grpc_opt=require_unimplemented_servers=false --go_out=. --go-grpc_out=. --proto_path=. *.proto protoc --go_opt=paths=source_relative ^
--go-grpc_opt=paths=source_relative ^
--go-grpc_opt=require_unimplemented_servers=false ^
--go_out=. --go-grpc_out=. --proto_path=. ^
./vars/*.proto ./mq/*.proto

@ -1,701 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.1
// protoc v3.19.4
// source: mq.proto
package pbMq
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type Platform int32
const (
Platform_bilibili Platform = 0 // B站
Platform_huya Platform = 1 // 虎牙
Platform_douyu Platform = 2 // 斗鱼
Platform_douyin Platform = 3 // 抖音
)
// Enum value maps for Platform.
var (
Platform_name = map[int32]string{
0: "bilibili",
1: "huya",
2: "douyu",
3: "douyin",
}
Platform_value = map[string]int32{
"bilibili": 0,
"huya": 1,
"douyu": 2,
"douyin": 3,
}
)
func (x Platform) Enum() *Platform {
p := new(Platform)
*p = x
return p
}
func (x Platform) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (Platform) Descriptor() protoreflect.EnumDescriptor {
return file_mq_proto_enumTypes[0].Descriptor()
}
func (Platform) Type() protoreflect.EnumType {
return &file_mq_proto_enumTypes[0]
}
func (x Platform) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use Platform.Descriptor instead.
func (Platform) EnumDescriptor() ([]byte, []int) {
return file_mq_proto_rawDescGZIP(), []int{0}
}
type MqNobilityBuy struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Platform string `protobuf:"bytes,1,opt,name=platform,proto3" json:"platform,omitempty"` // 平台
LiveRoomId int64 `protobuf:"varint,2,opt,name=liveRoomId,proto3" json:"liveRoomId,omitempty"` // 直播间ID
Uid int64 `protobuf:"varint,3,opt,name=uid,proto3" json:"uid,omitempty"` // 用户ID
Uname string `protobuf:"bytes,4,opt,name=uname,proto3" json:"uname,omitempty"` // 用户名
Avatar string `protobuf:"bytes,5,opt,name=avatar,proto3" json:"avatar,omitempty"` // 头像
MsgId string `protobuf:"bytes,6,opt,name=msgId,proto3" json:"msgId,omitempty"` // 消息唯一ID
NobilityLevel int64 `protobuf:"varint,7,opt,name=nobilityLevel,proto3" json:"nobilityLevel,omitempty"` // 贵族等级
Price int64 `protobuf:"varint,8,opt,name=price,proto3" json:"price,omitempty"` // 平台price
StartTime int64 `protobuf:"varint,9,opt,name=startTime,proto3" json:"startTime,omitempty"` // 开始时间
EndTime int64 `protobuf:"varint,10,opt,name=endTime,proto3" json:"endTime,omitempty"` // 过期时间
FansMedalWearingStatus bool `protobuf:"varint,11,opt,name=fansMedalWearingStatus,proto3" json:"fansMedalWearingStatus,omitempty"` // 牌子佩戴状态
FansMedalName string `protobuf:"bytes,12,opt,name=fansMedalName,proto3" json:"fansMedalName,omitempty"` // 粉丝牌子名
FansMedalLevel int64 `protobuf:"varint,13,opt,name=fansMedalLevel,proto3" json:"fansMedalLevel,omitempty"` // 粉丝牌子等级
}
func (x *MqNobilityBuy) Reset() {
*x = MqNobilityBuy{}
if protoimpl.UnsafeEnabled {
mi := &file_mq_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MqNobilityBuy) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MqNobilityBuy) ProtoMessage() {}
func (x *MqNobilityBuy) ProtoReflect() protoreflect.Message {
mi := &file_mq_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MqNobilityBuy.ProtoReflect.Descriptor instead.
func (*MqNobilityBuy) Descriptor() ([]byte, []int) {
return file_mq_proto_rawDescGZIP(), []int{0}
}
func (x *MqNobilityBuy) GetPlatform() string {
if x != nil {
return x.Platform
}
return ""
}
func (x *MqNobilityBuy) GetLiveRoomId() int64 {
if x != nil {
return x.LiveRoomId
}
return 0
}
func (x *MqNobilityBuy) GetUid() int64 {
if x != nil {
return x.Uid
}
return 0
}
func (x *MqNobilityBuy) GetUname() string {
if x != nil {
return x.Uname
}
return ""
}
func (x *MqNobilityBuy) GetAvatar() string {
if x != nil {
return x.Avatar
}
return ""
}
func (x *MqNobilityBuy) GetMsgId() string {
if x != nil {
return x.MsgId
}
return ""
}
func (x *MqNobilityBuy) GetNobilityLevel() int64 {
if x != nil {
return x.NobilityLevel
}
return 0
}
func (x *MqNobilityBuy) GetPrice() int64 {
if x != nil {
return x.Price
}
return 0
}
func (x *MqNobilityBuy) GetStartTime() int64 {
if x != nil {
return x.StartTime
}
return 0
}
func (x *MqNobilityBuy) GetEndTime() int64 {
if x != nil {
return x.EndTime
}
return 0
}
func (x *MqNobilityBuy) GetFansMedalWearingStatus() bool {
if x != nil {
return x.FansMedalWearingStatus
}
return false
}
func (x *MqNobilityBuy) GetFansMedalName() string {
if x != nil {
return x.FansMedalName
}
return ""
}
func (x *MqNobilityBuy) GetFansMedalLevel() int64 {
if x != nil {
return x.FansMedalLevel
}
return 0
}
type MqDanmaku struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Platform string `protobuf:"bytes,1,opt,name=platform,proto3" json:"platform,omitempty"` // 平台
LiveRoomId int64 `protobuf:"varint,2,opt,name=liveRoomId,proto3" json:"liveRoomId,omitempty"` // 直播间ID
Uid int64 `protobuf:"varint,3,opt,name=uid,proto3" json:"uid,omitempty"` // 用户ID
Uname string `protobuf:"bytes,4,opt,name=uname,proto3" json:"uname,omitempty"` // 用户名
Avatar string `protobuf:"bytes,5,opt,name=avatar,proto3" json:"avatar,omitempty"` // 头像
Msg string `protobuf:"bytes,6,opt,name=msg,proto3" json:"msg,omitempty"` // 内容
MsgId string `protobuf:"bytes,7,opt,name=msgId,proto3" json:"msgId,omitempty"` // 消息唯一ID
Timestamp int64 `protobuf:"varint,8,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // 发送时间
NobilityLevel int64 `protobuf:"varint,9,opt,name=nobilityLevel,proto3" json:"nobilityLevel,omitempty"` // 贵族等级
FansMedalWearingStatus bool `protobuf:"varint,10,opt,name=fansMedalWearingStatus,proto3" json:"fansMedalWearingStatus,omitempty"` // 牌子佩戴状态
FansMedalName string `protobuf:"bytes,11,opt,name=fansMedalName,proto3" json:"fansMedalName,omitempty"` // 粉丝牌子名
FansMedalLevel int64 `protobuf:"varint,12,opt,name=fansMedalLevel,proto3" json:"fansMedalLevel,omitempty"` // 粉丝牌子等级
}
func (x *MqDanmaku) Reset() {
*x = MqDanmaku{}
if protoimpl.UnsafeEnabled {
mi := &file_mq_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MqDanmaku) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MqDanmaku) ProtoMessage() {}
func (x *MqDanmaku) ProtoReflect() protoreflect.Message {
mi := &file_mq_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MqDanmaku.ProtoReflect.Descriptor instead.
func (*MqDanmaku) Descriptor() ([]byte, []int) {
return file_mq_proto_rawDescGZIP(), []int{1}
}
func (x *MqDanmaku) GetPlatform() string {
if x != nil {
return x.Platform
}
return ""
}
func (x *MqDanmaku) GetLiveRoomId() int64 {
if x != nil {
return x.LiveRoomId
}
return 0
}
func (x *MqDanmaku) GetUid() int64 {
if x != nil {
return x.Uid
}
return 0
}
func (x *MqDanmaku) GetUname() string {
if x != nil {
return x.Uname
}
return ""
}
func (x *MqDanmaku) GetAvatar() string {
if x != nil {
return x.Avatar
}
return ""
}
func (x *MqDanmaku) GetMsg() string {
if x != nil {
return x.Msg
}
return ""
}
func (x *MqDanmaku) GetMsgId() string {
if x != nil {
return x.MsgId
}
return ""
}
func (x *MqDanmaku) GetTimestamp() int64 {
if x != nil {
return x.Timestamp
}
return 0
}
func (x *MqDanmaku) GetNobilityLevel() int64 {
if x != nil {
return x.NobilityLevel
}
return 0
}
func (x *MqDanmaku) GetFansMedalWearingStatus() bool {
if x != nil {
return x.FansMedalWearingStatus
}
return false
}
func (x *MqDanmaku) GetFansMedalName() string {
if x != nil {
return x.FansMedalName
}
return ""
}
func (x *MqDanmaku) GetFansMedalLevel() int64 {
if x != nil {
return x.FansMedalLevel
}
return 0
}
type MqGift struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Platform string `protobuf:"bytes,1,opt,name=platform,proto3" json:"platform,omitempty"`
LiveRoomId int64 `protobuf:"varint,2,opt,name=liveRoomId,proto3" json:"liveRoomId,omitempty"`
Uid int64 `protobuf:"varint,3,opt,name=uid,proto3" json:"uid,omitempty"`
Uname string `protobuf:"bytes,4,opt,name=uname,proto3" json:"uname,omitempty"`
Avatar string `protobuf:"bytes,5,opt,name=avatar,proto3" json:"avatar,omitempty"` // 头像
GiftId int64 `protobuf:"varint,6,opt,name=giftId,proto3" json:"giftId,omitempty"`
GiftName string `protobuf:"bytes,7,opt,name=giftName,proto3" json:"giftName,omitempty"`
GiftNum int64 `protobuf:"varint,8,opt,name=giftNum,proto3" json:"giftNum,omitempty"`
Price int64 `protobuf:"varint,9,opt,name=price,proto3" json:"price,omitempty"`
IsPaid bool `protobuf:"varint,10,opt,name=isPaid,proto3" json:"isPaid,omitempty"`
MsgId string `protobuf:"bytes,11,opt,name=msgId,proto3" json:"msgId,omitempty"` // 消息唯一ID
Timestamp int64 `protobuf:"varint,12,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // 收礼时间
NobilityLevel int64 `protobuf:"varint,13,opt,name=nobilityLevel,proto3" json:"nobilityLevel,omitempty"` // 贵族等级
FansMedalWearingStatus bool `protobuf:"varint,14,opt,name=fansMedalWearingStatus,proto3" json:"fansMedalWearingStatus,omitempty"` // 牌子佩戴状态
FansMedalName string `protobuf:"bytes,15,opt,name=fansMedalName,proto3" json:"fansMedalName,omitempty"` // 粉丝牌子名
FansMedalLevel int64 `protobuf:"varint,16,opt,name=fansMedalLevel,proto3" json:"fansMedalLevel,omitempty"` // 粉丝牌子等级
}
func (x *MqGift) Reset() {
*x = MqGift{}
if protoimpl.UnsafeEnabled {
mi := &file_mq_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MqGift) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MqGift) ProtoMessage() {}
func (x *MqGift) ProtoReflect() protoreflect.Message {
mi := &file_mq_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MqGift.ProtoReflect.Descriptor instead.
func (*MqGift) Descriptor() ([]byte, []int) {
return file_mq_proto_rawDescGZIP(), []int{2}
}
func (x *MqGift) GetPlatform() string {
if x != nil {
return x.Platform
}
return ""
}
func (x *MqGift) GetLiveRoomId() int64 {
if x != nil {
return x.LiveRoomId
}
return 0
}
func (x *MqGift) GetUid() int64 {
if x != nil {
return x.Uid
}
return 0
}
func (x *MqGift) GetUname() string {
if x != nil {
return x.Uname
}
return ""
}
func (x *MqGift) GetAvatar() string {
if x != nil {
return x.Avatar
}
return ""
}
func (x *MqGift) GetGiftId() int64 {
if x != nil {
return x.GiftId
}
return 0
}
func (x *MqGift) GetGiftName() string {
if x != nil {
return x.GiftName
}
return ""
}
func (x *MqGift) GetGiftNum() int64 {
if x != nil {
return x.GiftNum
}
return 0
}
func (x *MqGift) GetPrice() int64 {
if x != nil {
return x.Price
}
return 0
}
func (x *MqGift) GetIsPaid() bool {
if x != nil {
return x.IsPaid
}
return false
}
func (x *MqGift) GetMsgId() string {
if x != nil {
return x.MsgId
}
return ""
}
func (x *MqGift) GetTimestamp() int64 {
if x != nil {
return x.Timestamp
}
return 0
}
func (x *MqGift) GetNobilityLevel() int64 {
if x != nil {
return x.NobilityLevel
}
return 0
}
func (x *MqGift) GetFansMedalWearingStatus() bool {
if x != nil {
return x.FansMedalWearingStatus
}
return false
}
func (x *MqGift) GetFansMedalName() string {
if x != nil {
return x.FansMedalName
}
return ""
}
func (x *MqGift) GetFansMedalLevel() int64 {
if x != nil {
return x.FansMedalLevel
}
return 0
}
var File_mq_proto protoreflect.FileDescriptor
var file_mq_proto_rawDesc = []byte{
0x0a, 0x08, 0x6d, 0x71, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x9b,
0x03, 0x0a, 0x0d, 0x4d, 0x71, 0x4e, 0x6f, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x42, 0x75, 0x79,
0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x1e, 0x0a, 0x0a,
0x6c, 0x69, 0x76, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03,
0x52, 0x0a, 0x6c, 0x69, 0x76, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03,
0x75, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x14,
0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x75,
0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x05,
0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x14, 0x0a, 0x05,
0x6d, 0x73, 0x67, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x73, 0x67,
0x49, 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x6e, 0x6f, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x4c, 0x65,
0x76, 0x65, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x6e, 0x6f, 0x62, 0x69, 0x6c,
0x69, 0x74, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63,
0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1c,
0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28,
0x03, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07,
0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65,
0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x16, 0x66, 0x61, 0x6e, 0x73, 0x4d, 0x65,
0x64, 0x61, 0x6c, 0x57, 0x65, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,
0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x66, 0x61, 0x6e, 0x73, 0x4d, 0x65, 0x64, 0x61,
0x6c, 0x57, 0x65, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x24,
0x0a, 0x0d, 0x66, 0x61, 0x6e, 0x73, 0x4d, 0x65, 0x64, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x18,
0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x66, 0x61, 0x6e, 0x73, 0x4d, 0x65, 0x64, 0x61, 0x6c,
0x4e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x66, 0x61, 0x6e, 0x73, 0x4d, 0x65, 0x64, 0x61,
0x6c, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x66, 0x61,
0x6e, 0x73, 0x4d, 0x65, 0x64, 0x61, 0x6c, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0xf9, 0x02, 0x0a,
0x09, 0x4d, 0x71, 0x44, 0x61, 0x6e, 0x6d, 0x61, 0x6b, 0x75, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c,
0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c,
0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x1e, 0x0a, 0x0a, 0x6c, 0x69, 0x76, 0x65, 0x52, 0x6f,
0x6f, 0x6d, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6c, 0x69, 0x76, 0x65,
0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x03, 0x20,
0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d,
0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16,
0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,
0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x06, 0x20,
0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x73, 0x67, 0x49,
0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x73, 0x67, 0x49, 0x64, 0x12, 0x1c,
0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28,
0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x24, 0x0a, 0x0d,
0x6e, 0x6f, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x09, 0x20,
0x01, 0x28, 0x03, 0x52, 0x0d, 0x6e, 0x6f, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x4c, 0x65, 0x76,
0x65, 0x6c, 0x12, 0x36, 0x0a, 0x16, 0x66, 0x61, 0x6e, 0x73, 0x4d, 0x65, 0x64, 0x61, 0x6c, 0x57,
0x65, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0a, 0x20, 0x01,
0x28, 0x08, 0x52, 0x16, 0x66, 0x61, 0x6e, 0x73, 0x4d, 0x65, 0x64, 0x61, 0x6c, 0x57, 0x65, 0x61,
0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x66, 0x61,
0x6e, 0x73, 0x4d, 0x65, 0x64, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0d, 0x66, 0x61, 0x6e, 0x73, 0x4d, 0x65, 0x64, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65,
0x12, 0x26, 0x0a, 0x0e, 0x66, 0x61, 0x6e, 0x73, 0x4d, 0x65, 0x64, 0x61, 0x6c, 0x4c, 0x65, 0x76,
0x65, 0x6c, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x66, 0x61, 0x6e, 0x73, 0x4d, 0x65,
0x64, 0x61, 0x6c, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0xe0, 0x03, 0x0a, 0x06, 0x4d, 0x71, 0x47,
0x69, 0x66, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12,
0x1e, 0x0a, 0x0a, 0x6c, 0x69, 0x76, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18, 0x02, 0x20,
0x01, 0x28, 0x03, 0x52, 0x0a, 0x6c, 0x69, 0x76, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12,
0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69,
0x64, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09,
0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61,
0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12,
0x16, 0x0a, 0x06, 0x67, 0x69, 0x66, 0x74, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52,
0x06, 0x67, 0x69, 0x66, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x69, 0x66, 0x74, 0x4e,
0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x69, 0x66, 0x74, 0x4e,
0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x75, 0x6d, 0x18, 0x08,
0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x14, 0x0a,
0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, 0x72,
0x69, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x50, 0x61, 0x69, 0x64, 0x18, 0x0a, 0x20,
0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x50, 0x61, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6d,
0x73, 0x67, 0x49, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x73, 0x67, 0x49,
0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0c,
0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12,
0x24, 0x0a, 0x0d, 0x6e, 0x6f, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c,
0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x6e, 0x6f, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79,
0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x36, 0x0a, 0x16, 0x66, 0x61, 0x6e, 0x73, 0x4d, 0x65, 0x64,
0x61, 0x6c, 0x57, 0x65, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18,
0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x66, 0x61, 0x6e, 0x73, 0x4d, 0x65, 0x64, 0x61, 0x6c,
0x57, 0x65, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x24, 0x0a,
0x0d, 0x66, 0x61, 0x6e, 0x73, 0x4d, 0x65, 0x64, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x0f,
0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x66, 0x61, 0x6e, 0x73, 0x4d, 0x65, 0x64, 0x61, 0x6c, 0x4e,
0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x66, 0x61, 0x6e, 0x73, 0x4d, 0x65, 0x64, 0x61, 0x6c,
0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x10, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x66, 0x61, 0x6e,
0x73, 0x4d, 0x65, 0x64, 0x61, 0x6c, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x2a, 0x39, 0x0a, 0x08, 0x50,
0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x0c, 0x0a, 0x08, 0x62, 0x69, 0x6c, 0x69, 0x62,
0x69, 0x6c, 0x69, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x68, 0x75, 0x79, 0x61, 0x10, 0x01, 0x12,
0x09, 0x0a, 0x05, 0x64, 0x6f, 0x75, 0x79, 0x75, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x64, 0x6f,
0x75, 0x79, 0x69, 0x6e, 0x10, 0x03, 0x42, 0x07, 0x5a, 0x05, 0x2f, 0x70, 0x62, 0x4d, 0x71, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_mq_proto_rawDescOnce sync.Once
file_mq_proto_rawDescData = file_mq_proto_rawDesc
)
func file_mq_proto_rawDescGZIP() []byte {
file_mq_proto_rawDescOnce.Do(func() {
file_mq_proto_rawDescData = protoimpl.X.CompressGZIP(file_mq_proto_rawDescData)
})
return file_mq_proto_rawDescData
}
var file_mq_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_mq_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_mq_proto_goTypes = []interface{}{
(Platform)(0), // 0: pb.Platform
(*MqNobilityBuy)(nil), // 1: pb.MqNobilityBuy
(*MqDanmaku)(nil), // 2: pb.MqDanmaku
(*MqGift)(nil), // 3: pb.MqGift
}
var file_mq_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_mq_proto_init() }
func file_mq_proto_init() {
if File_mq_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_mq_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MqNobilityBuy); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_mq_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MqDanmaku); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_mq_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MqGift); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_mq_proto_rawDesc,
NumEnums: 1,
NumMessages: 3,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_mq_proto_goTypes,
DependencyIndexes: file_mq_proto_depIdxs,
EnumInfos: file_mq_proto_enumTypes,
MessageInfos: file_mq_proto_msgTypes,
}.Build()
File_mq_proto = out.File
file_mq_proto_rawDesc = nil
file_mq_proto_goTypes = nil
file_mq_proto_depIdxs = nil
}

@ -0,0 +1,794 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.1
// protoc v3.19.4
// source: mq/mq.proto
package pbMq
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type MqGift_Type int32
const (
MqGift_NORMAL MqGift_Type = 0
MqGift_PACK MqGift_Type = 1 // 包裹类,白银宝箱一类的礼物
MqGift_RED_PACK MqGift_Type = 2 // 红包类,抽放给观众的礼物
)
// Enum value maps for MqGift_Type.
var (
MqGift_Type_name = map[int32]string{
0: "NORMAL",
1: "PACK",
2: "RED_PACK",
}
MqGift_Type_value = map[string]int32{
"NORMAL": 0,
"PACK": 1,
"RED_PACK": 2,
}
)
func (x MqGift_Type) Enum() *MqGift_Type {
p := new(MqGift_Type)
*p = x
return p
}
func (x MqGift_Type) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (MqGift_Type) Descriptor() protoreflect.EnumDescriptor {
return file_mq_mq_proto_enumTypes[0].Descriptor()
}
func (MqGift_Type) Type() protoreflect.EnumType {
return &file_mq_mq_proto_enumTypes[0]
}
func (x MqGift_Type) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use MqGift_Type.Descriptor instead.
func (MqGift_Type) EnumDescriptor() ([]byte, []int) {
return file_mq_mq_proto_rawDescGZIP(), []int{2, 0}
}
type MqNobilityBuy struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Platform string `protobuf:"bytes,1,opt,name=platform,proto3" json:"platform,omitempty"` // 平台
LiveRoomId int64 `protobuf:"varint,2,opt,name=liveRoomId,proto3" json:"liveRoomId,omitempty"` // 直播间ID
Uid int64 `protobuf:"varint,3,opt,name=uid,proto3" json:"uid,omitempty"` // 用户ID
Uname string `protobuf:"bytes,4,opt,name=uname,proto3" json:"uname,omitempty"` // 用户名
Avatar string `protobuf:"bytes,5,opt,name=avatar,proto3" json:"avatar,omitempty"` // 头像
MsgId string `protobuf:"bytes,6,opt,name=msgId,proto3" json:"msgId,omitempty"` // 消息唯一ID
NobilityLevel int64 `protobuf:"varint,7,opt,name=nobilityLevel,proto3" json:"nobilityLevel,omitempty"` // 贵族等级
Price int64 `protobuf:"varint,8,opt,name=price,proto3" json:"price,omitempty"` // 平台price
StartTime int64 `protobuf:"varint,9,opt,name=startTime,proto3" json:"startTime,omitempty"` // 开始时间
EndTime int64 `protobuf:"varint,10,opt,name=endTime,proto3" json:"endTime,omitempty"` // 过期时间
FansMedalWearingStatus bool `protobuf:"varint,11,opt,name=fansMedalWearingStatus,proto3" json:"fansMedalWearingStatus,omitempty"` // 牌子佩戴状态
FansMedalName string `protobuf:"bytes,12,opt,name=fansMedalName,proto3" json:"fansMedalName,omitempty"` // 粉丝牌子名
FansMedalLevel int64 `protobuf:"varint,13,opt,name=fansMedalLevel,proto3" json:"fansMedalLevel,omitempty"` // 粉丝牌子等级
}
func (x *MqNobilityBuy) Reset() {
*x = MqNobilityBuy{}
if protoimpl.UnsafeEnabled {
mi := &file_mq_mq_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MqNobilityBuy) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MqNobilityBuy) ProtoMessage() {}
func (x *MqNobilityBuy) ProtoReflect() protoreflect.Message {
mi := &file_mq_mq_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MqNobilityBuy.ProtoReflect.Descriptor instead.
func (*MqNobilityBuy) Descriptor() ([]byte, []int) {
return file_mq_mq_proto_rawDescGZIP(), []int{0}
}
func (x *MqNobilityBuy) GetPlatform() string {
if x != nil {
return x.Platform
}
return ""
}
func (x *MqNobilityBuy) GetLiveRoomId() int64 {
if x != nil {
return x.LiveRoomId
}
return 0
}
func (x *MqNobilityBuy) GetUid() int64 {
if x != nil {
return x.Uid
}
return 0
}
func (x *MqNobilityBuy) GetUname() string {
if x != nil {
return x.Uname
}
return ""
}
func (x *MqNobilityBuy) GetAvatar() string {
if x != nil {
return x.Avatar
}
return ""
}
func (x *MqNobilityBuy) GetMsgId() string {
if x != nil {
return x.MsgId
}
return ""
}
func (x *MqNobilityBuy) GetNobilityLevel() int64 {
if x != nil {
return x.NobilityLevel
}
return 0
}
func (x *MqNobilityBuy) GetPrice() int64 {
if x != nil {
return x.Price
}
return 0
}
func (x *MqNobilityBuy) GetStartTime() int64 {
if x != nil {
return x.StartTime
}
return 0
}
func (x *MqNobilityBuy) GetEndTime() int64 {
if x != nil {
return x.EndTime
}
return 0
}
func (x *MqNobilityBuy) GetFansMedalWearingStatus() bool {
if x != nil {
return x.FansMedalWearingStatus
}
return false
}
func (x *MqNobilityBuy) GetFansMedalName() string {
if x != nil {
return x.FansMedalName
}
return ""
}
func (x *MqNobilityBuy) GetFansMedalLevel() int64 {
if x != nil {
return x.FansMedalLevel
}
return 0
}
type MqDanmaku struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Platform string `protobuf:"bytes,1,opt,name=platform,proto3" json:"platform,omitempty"` // 平台
LiveRoomId int64 `protobuf:"varint,2,opt,name=liveRoomId,proto3" json:"liveRoomId,omitempty"` // 直播间ID
Uid int64 `protobuf:"varint,3,opt,name=uid,proto3" json:"uid,omitempty"` // 用户ID
Uname string `protobuf:"bytes,4,opt,name=uname,proto3" json:"uname,omitempty"` // 用户名
Avatar string `protobuf:"bytes,5,opt,name=avatar,proto3" json:"avatar,omitempty"` // 头像
Msg string `protobuf:"bytes,6,opt,name=msg,proto3" json:"msg,omitempty"` // 内容
MsgId string `protobuf:"bytes,7,opt,name=msgId,proto3" json:"msgId,omitempty"` // 消息唯一ID
Timestamp int64 `protobuf:"varint,8,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // 发送时间
NobilityLevel int64 `protobuf:"varint,9,opt,name=nobilityLevel,proto3" json:"nobilityLevel,omitempty"` // 贵族等级
FansMedalWearingStatus bool `protobuf:"varint,10,opt,name=fansMedalWearingStatus,proto3" json:"fansMedalWearingStatus,omitempty"` // 牌子佩戴状态
FansMedalName string `protobuf:"bytes,11,opt,name=fansMedalName,proto3" json:"fansMedalName,omitempty"` // 粉丝牌子名
FansMedalLevel int64 `protobuf:"varint,12,opt,name=fansMedalLevel,proto3" json:"fansMedalLevel,omitempty"` // 粉丝牌子等级
}
func (x *MqDanmaku) Reset() {
*x = MqDanmaku{}
if protoimpl.UnsafeEnabled {
mi := &file_mq_mq_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MqDanmaku) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MqDanmaku) ProtoMessage() {}
func (x *MqDanmaku) ProtoReflect() protoreflect.Message {
mi := &file_mq_mq_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MqDanmaku.ProtoReflect.Descriptor instead.
func (*MqDanmaku) Descriptor() ([]byte, []int) {
return file_mq_mq_proto_rawDescGZIP(), []int{1}
}
func (x *MqDanmaku) GetPlatform() string {
if x != nil {
return x.Platform
}
return ""
}
func (x *MqDanmaku) GetLiveRoomId() int64 {
if x != nil {
return x.LiveRoomId
}
return 0
}
func (x *MqDanmaku) GetUid() int64 {
if x != nil {
return x.Uid
}
return 0
}
func (x *MqDanmaku) GetUname() string {
if x != nil {
return x.Uname
}
return ""
}
func (x *MqDanmaku) GetAvatar() string {
if x != nil {
return x.Avatar
}
return ""
}
func (x *MqDanmaku) GetMsg() string {
if x != nil {
return x.Msg
}
return ""
}
func (x *MqDanmaku) GetMsgId() string {
if x != nil {
return x.MsgId
}
return ""
}
func (x *MqDanmaku) GetTimestamp() int64 {
if x != nil {
return x.Timestamp
}
return 0
}
func (x *MqDanmaku) GetNobilityLevel() int64 {
if x != nil {
return x.NobilityLevel
}
return 0
}
func (x *MqDanmaku) GetFansMedalWearingStatus() bool {
if x != nil {
return x.FansMedalWearingStatus
}
return false
}
func (x *MqDanmaku) GetFansMedalName() string {
if x != nil {
return x.FansMedalName
}
return ""
}
func (x *MqDanmaku) GetFansMedalLevel() int64 {
if x != nil {
return x.FansMedalLevel
}
return 0
}
type MqGift struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Platform string `protobuf:"bytes,1,opt,name=platform,proto3" json:"platform,omitempty"`
LiveRoomId int64 `protobuf:"varint,2,opt,name=liveRoomId,proto3" json:"liveRoomId,omitempty"`
MsgId string `protobuf:"bytes,3,opt,name=msgId,proto3" json:"msgId,omitempty"` // 消息唯一ID
Timestamp int64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // 送礼时间
Uid int64 `protobuf:"varint,5,opt,name=uid,proto3" json:"uid,omitempty"`
Uname string `protobuf:"bytes,6,opt,name=uname,proto3" json:"uname,omitempty"`
Avatar string `protobuf:"bytes,7,opt,name=avatar,proto3" json:"avatar,omitempty"` // 头像
NobilityLevel int64 `protobuf:"varint,8,opt,name=nobilityLevel,proto3" json:"nobilityLevel,omitempty"` // 贵族等级
GiftId int64 `protobuf:"varint,9,opt,name=giftId,proto3" json:"giftId,omitempty"` // 礼物ID
GiftName string `protobuf:"bytes,10,opt,name=giftName,proto3" json:"giftName,omitempty"` // 礼物名称
GiftNum int64 `protobuf:"varint,11,opt,name=giftNum,proto3" json:"giftNum,omitempty"` // 单次送礼数量
Price int64 `protobuf:"varint,12,opt,name=price,proto3" json:"price,omitempty"` // 平台礼物价值(平台货币)
IsPaid bool `protobuf:"varint,13,opt,name=isPaid,proto3" json:"isPaid,omitempty"` // 是否付费
Type MqGift_Type `protobuf:"varint,14,opt,name=type,proto3,enum=pb.MqGift_Type" json:"type,omitempty"` // 礼物类型
PackGift *MqGift_PackGift `protobuf:"bytes,15,opt,name=packGift,proto3" json:"packGift,omitempty"`
FansMedalWearingStatus bool `protobuf:"varint,20,opt,name=fansMedalWearingStatus,proto3" json:"fansMedalWearingStatus,omitempty"` // 牌子佩戴状态
FansMedalName string `protobuf:"bytes,21,opt,name=fansMedalName,proto3" json:"fansMedalName,omitempty"` // 粉丝牌子名
FansMedalLevel int64 `protobuf:"varint,22,opt,name=fansMedalLevel,proto3" json:"fansMedalLevel,omitempty"` // 粉丝牌子等级
}
func (x *MqGift) Reset() {
*x = MqGift{}
if protoimpl.UnsafeEnabled {
mi := &file_mq_mq_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MqGift) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MqGift) ProtoMessage() {}
func (x *MqGift) ProtoReflect() protoreflect.Message {
mi := &file_mq_mq_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MqGift.ProtoReflect.Descriptor instead.
func (*MqGift) Descriptor() ([]byte, []int) {
return file_mq_mq_proto_rawDescGZIP(), []int{2}
}
func (x *MqGift) GetPlatform() string {
if x != nil {
return x.Platform
}
return ""
}
func (x *MqGift) GetLiveRoomId() int64 {
if x != nil {
return x.LiveRoomId
}
return 0
}
func (x *MqGift) GetMsgId() string {
if x != nil {
return x.MsgId
}
return ""
}
func (x *MqGift) GetTimestamp() int64 {
if x != nil {
return x.Timestamp
}
return 0
}
func (x *MqGift) GetUid() int64 {
if x != nil {
return x.Uid
}
return 0
}
func (x *MqGift) GetUname() string {
if x != nil {
return x.Uname
}
return ""
}
func (x *MqGift) GetAvatar() string {
if x != nil {
return x.Avatar
}
return ""
}
func (x *MqGift) GetNobilityLevel() int64 {
if x != nil {
return x.NobilityLevel
}
return 0
}
func (x *MqGift) GetGiftId() int64 {
if x != nil {
return x.GiftId
}
return 0
}
func (x *MqGift) GetGiftName() string {
if x != nil {
return x.GiftName
}
return ""
}
func (x *MqGift) GetGiftNum() int64 {
if x != nil {
return x.GiftNum
}
return 0
}
func (x *MqGift) GetPrice() int64 {
if x != nil {
return x.Price
}
return 0
}
func (x *MqGift) GetIsPaid() bool {
if x != nil {
return x.IsPaid
}
return false
}
func (x *MqGift) GetType() MqGift_Type {
if x != nil {
return x.Type
}
return MqGift_NORMAL
}
func (x *MqGift) GetPackGift() *MqGift_PackGift {
if x != nil {
return x.PackGift
}
return nil
}
func (x *MqGift) GetFansMedalWearingStatus() bool {
if x != nil {
return x.FansMedalWearingStatus
}
return false
}
func (x *MqGift) GetFansMedalName() string {
if x != nil {
return x.FansMedalName
}
return ""
}
func (x *MqGift) GetFansMedalLevel() int64 {
if x != nil {
return x.FansMedalLevel
}
return 0
}
// 礼物(包裹)
type MqGift_PackGift struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
GiftId int64 `protobuf:"varint,1,opt,name=giftId,proto3" json:"giftId,omitempty"`
GiftName string `protobuf:"bytes,2,opt,name=giftName,proto3" json:"giftName,omitempty"` // 礼物名称
}
func (x *MqGift_PackGift) Reset() {
*x = MqGift_PackGift{}
if protoimpl.UnsafeEnabled {
mi := &file_mq_mq_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MqGift_PackGift) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MqGift_PackGift) ProtoMessage() {}
func (x *MqGift_PackGift) ProtoReflect() protoreflect.Message {
mi := &file_mq_mq_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MqGift_PackGift.ProtoReflect.Descriptor instead.
func (*MqGift_PackGift) Descriptor() ([]byte, []int) {
return file_mq_mq_proto_rawDescGZIP(), []int{2, 0}
}
func (x *MqGift_PackGift) GetGiftId() int64 {
if x != nil {
return x.GiftId
}
return 0
}
func (x *MqGift_PackGift) GetGiftName() string {
if x != nil {
return x.GiftName
}
return ""
}
var File_mq_mq_proto protoreflect.FileDescriptor
var file_mq_mq_proto_rawDesc = []byte{
0x0a, 0x0b, 0x6d, 0x71, 0x2f, 0x6d, 0x71, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70,
0x62, 0x22, 0x9b, 0x03, 0x0a, 0x0d, 0x4d, 0x71, 0x4e, 0x6f, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79,
0x42, 0x75, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12,
0x1e, 0x0a, 0x0a, 0x6c, 0x69, 0x76, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18, 0x02, 0x20,
0x01, 0x28, 0x03, 0x52, 0x0a, 0x6c, 0x69, 0x76, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12,
0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69,
0x64, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09,
0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61,
0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12,
0x14, 0x0a, 0x05, 0x6d, 0x73, 0x67, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
0x6d, 0x73, 0x67, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x6e, 0x6f, 0x62, 0x69, 0x6c, 0x69, 0x74,
0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x6e, 0x6f,
0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x70,
0x72, 0x69, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63,
0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x09,
0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12,
0x18, 0x0a, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03,
0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x16, 0x66, 0x61, 0x6e,
0x73, 0x4d, 0x65, 0x64, 0x61, 0x6c, 0x57, 0x65, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61,
0x74, 0x75, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x66, 0x61, 0x6e, 0x73, 0x4d,
0x65, 0x64, 0x61, 0x6c, 0x57, 0x65, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75,
0x73, 0x12, 0x24, 0x0a, 0x0d, 0x66, 0x61, 0x6e, 0x73, 0x4d, 0x65, 0x64, 0x61, 0x6c, 0x4e, 0x61,
0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x66, 0x61, 0x6e, 0x73, 0x4d, 0x65,
0x64, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x66, 0x61, 0x6e, 0x73, 0x4d,
0x65, 0x64, 0x61, 0x6c, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52,
0x0e, 0x66, 0x61, 0x6e, 0x73, 0x4d, 0x65, 0x64, 0x61, 0x6c, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22,
0xf9, 0x02, 0x0a, 0x09, 0x4d, 0x71, 0x44, 0x61, 0x6e, 0x6d, 0x61, 0x6b, 0x75, 0x12, 0x1a, 0x0a,
0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x1e, 0x0a, 0x0a, 0x6c, 0x69, 0x76,
0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6c,
0x69, 0x76, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64,
0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x75,
0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d,
0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28,
0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67,
0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x6d,
0x73, 0x67, 0x49, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x73, 0x67, 0x49,
0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x08,
0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12,
0x24, 0x0a, 0x0d, 0x6e, 0x6f, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c,
0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x6e, 0x6f, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79,
0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x36, 0x0a, 0x16, 0x66, 0x61, 0x6e, 0x73, 0x4d, 0x65, 0x64,
0x61, 0x6c, 0x57, 0x65, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18,
0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x66, 0x61, 0x6e, 0x73, 0x4d, 0x65, 0x64, 0x61, 0x6c,
0x57, 0x65, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x24, 0x0a,
0x0d, 0x66, 0x61, 0x6e, 0x73, 0x4d, 0x65, 0x64, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x0b,
0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x66, 0x61, 0x6e, 0x73, 0x4d, 0x65, 0x64, 0x61, 0x6c, 0x4e,
0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x66, 0x61, 0x6e, 0x73, 0x4d, 0x65, 0x64, 0x61, 0x6c,
0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x66, 0x61, 0x6e,
0x73, 0x4d, 0x65, 0x64, 0x61, 0x6c, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0xa2, 0x05, 0x0a, 0x06,
0x4d, 0x71, 0x47, 0x69, 0x66, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f,
0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f,
0x72, 0x6d, 0x12, 0x1e, 0x0a, 0x0a, 0x6c, 0x69, 0x76, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64,
0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6c, 0x69, 0x76, 0x65, 0x52, 0x6f, 0x6f, 0x6d,
0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x73, 0x67, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28,
0x09, 0x52, 0x05, 0x6d, 0x73, 0x67, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65,
0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d,
0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x05, 0x20,
0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d,
0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16,
0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,
0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x24, 0x0a, 0x0d, 0x6e, 0x6f, 0x62, 0x69, 0x6c, 0x69,
0x74, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x6e,
0x6f, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x16, 0x0a, 0x06,
0x67, 0x69, 0x66, 0x74, 0x49, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x67, 0x69,
0x66, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x61, 0x6d, 0x65,
0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x61, 0x6d, 0x65,
0x12, 0x18, 0x0a, 0x07, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x75, 0x6d, 0x18, 0x0b, 0x20, 0x01, 0x28,
0x03, 0x52, 0x07, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72,
0x69, 0x63, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65,
0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x50, 0x61, 0x69, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08,
0x52, 0x06, 0x69, 0x73, 0x50, 0x61, 0x69, 0x64, 0x12, 0x23, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65,
0x18, 0x0e, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x71, 0x47, 0x69,
0x66, 0x74, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2f, 0x0a,
0x08, 0x70, 0x61, 0x63, 0x6b, 0x47, 0x69, 0x66, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x13, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x71, 0x47, 0x69, 0x66, 0x74, 0x2e, 0x50, 0x61, 0x63, 0x6b,
0x47, 0x69, 0x66, 0x74, 0x52, 0x08, 0x70, 0x61, 0x63, 0x6b, 0x47, 0x69, 0x66, 0x74, 0x12, 0x36,
0x0a, 0x16, 0x66, 0x61, 0x6e, 0x73, 0x4d, 0x65, 0x64, 0x61, 0x6c, 0x57, 0x65, 0x61, 0x72, 0x69,
0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16,
0x66, 0x61, 0x6e, 0x73, 0x4d, 0x65, 0x64, 0x61, 0x6c, 0x57, 0x65, 0x61, 0x72, 0x69, 0x6e, 0x67,
0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x66, 0x61, 0x6e, 0x73, 0x4d, 0x65,
0x64, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x15, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x66,
0x61, 0x6e, 0x73, 0x4d, 0x65, 0x64, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0e,
0x66, 0x61, 0x6e, 0x73, 0x4d, 0x65, 0x64, 0x61, 0x6c, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x16,
0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x66, 0x61, 0x6e, 0x73, 0x4d, 0x65, 0x64, 0x61, 0x6c, 0x4c,
0x65, 0x76, 0x65, 0x6c, 0x1a, 0x3e, 0x0a, 0x08, 0x50, 0x61, 0x63, 0x6b, 0x47, 0x69, 0x66, 0x74,
0x12, 0x16, 0x0a, 0x06, 0x67, 0x69, 0x66, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03,
0x52, 0x06, 0x67, 0x69, 0x66, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x69, 0x66, 0x74,
0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x69, 0x66, 0x74,
0x4e, 0x61, 0x6d, 0x65, 0x22, 0x2a, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06,
0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x50, 0x41, 0x43, 0x4b,
0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x52, 0x45, 0x44, 0x5f, 0x50, 0x41, 0x43, 0x4b, 0x10, 0x02,
0x42, 0x07, 0x5a, 0x05, 0x2f, 0x70, 0x62, 0x4d, 0x71, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}
var (
file_mq_mq_proto_rawDescOnce sync.Once
file_mq_mq_proto_rawDescData = file_mq_mq_proto_rawDesc
)
func file_mq_mq_proto_rawDescGZIP() []byte {
file_mq_mq_proto_rawDescOnce.Do(func() {
file_mq_mq_proto_rawDescData = protoimpl.X.CompressGZIP(file_mq_mq_proto_rawDescData)
})
return file_mq_mq_proto_rawDescData
}
var file_mq_mq_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_mq_mq_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_mq_mq_proto_goTypes = []interface{}{
(MqGift_Type)(0), // 0: pb.MqGift.Type
(*MqNobilityBuy)(nil), // 1: pb.MqNobilityBuy
(*MqDanmaku)(nil), // 2: pb.MqDanmaku
(*MqGift)(nil), // 3: pb.MqGift
(*MqGift_PackGift)(nil), // 4: pb.MqGift.PackGift
}
var file_mq_mq_proto_depIdxs = []int32{
0, // 0: pb.MqGift.type:type_name -> pb.MqGift.Type
4, // 1: pb.MqGift.packGift:type_name -> pb.MqGift.PackGift
2, // [2:2] is the sub-list for method output_type
2, // [2:2] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_mq_mq_proto_init() }
func file_mq_mq_proto_init() {
if File_mq_mq_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_mq_mq_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MqNobilityBuy); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_mq_mq_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MqDanmaku); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_mq_mq_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MqGift); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_mq_mq_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MqGift_PackGift); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_mq_mq_proto_rawDesc,
NumEnums: 1,
NumMessages: 4,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_mq_mq_proto_goTypes,
DependencyIndexes: file_mq_mq_proto_depIdxs,
EnumInfos: file_mq_mq_proto_enumTypes,
MessageInfos: file_mq_mq_proto_msgTypes,
}.Build()
File_mq_mq_proto = out.File
file_mq_mq_proto_rawDesc = nil
file_mq_mq_proto_goTypes = nil
file_mq_mq_proto_depIdxs = nil
}

@ -4,13 +4,6 @@ package pb;
option go_package = "/pbMq"; option go_package = "/pbMq";
enum Platform {
bilibili = 0; // B
huya = 1; //
douyu = 2; //
douyin = 3; //
}
message MqNobilityBuy { message MqNobilityBuy {
string platform = 1; // string platform = 1; //
int64 liveRoomId = 2; // ID int64 liveRoomId = 2; // ID
@ -38,28 +31,41 @@ message MqDanmaku {
string msgId = 7; // ID string msgId = 7; // ID
int64 timestamp = 8; // int64 timestamp = 8; //
int64 nobilityLevel = 9; // int64 nobilityLevel = 9; //
bool fansMedalWearingStatus = 10; // bool fansMedalWearingStatus = 10; //
string fansMedalName = 11; // string fansMedalName = 11; //
int64 fansMedalLevel = 12; // int64 fansMedalLevel = 12; //
} }
message MqGift { message MqGift {
enum Type {
NORMAL = 0;
PACK = 1; // ,
RED_PACK = 2; // ,
}
// ()
message PackGift {
int64 giftId = 1;
string giftName = 2; //
}
string platform = 1; string platform = 1;
int64 liveRoomId = 2; int64 liveRoomId = 2;
int64 uid = 3; string msgId = 3; // ID
string uname = 4; int64 timestamp = 4; //
string avatar = 5; // int64 uid = 5;
string uname = 6;
string avatar = 7; //
int64 nobilityLevel = 8; //
int64 giftId = 6; int64 giftId = 9; // ID
string giftName = 7; string giftName = 10; //
int64 giftNum = 8; int64 giftNum = 11; //
int64 price = 9; int64 price = 12; //
bool isPaid = 10; bool isPaid = 13; //
Type type = 14; //
PackGift packGift = 15;
string msgId = 11; // ID bool fansMedalWearingStatus = 20; //
int64 timestamp = 12; // string fansMedalName = 21; //
int64 nobilityLevel = 13; // int64 fansMedalLevel = 22; //
bool fansMedalWearingStatus = 14; //
string fansMedalName = 15; //
int64 fansMedalLevel = 16; //
} }

@ -0,0 +1,52 @@
syntax = "proto3";
package pb.vars;
option go_package = "dcg/game/pb/vars;pbVars";
enum Platform {
Bilibili = 0; // B
Huya = 1; //
Douyu = 2; //
Tiktok = 3; //
}
enum UserCoinChangedReason {
/////
Pay = 0; //
BuyBattleFood = 1; //
BuyEliteUnit = 2; //
BuyTitle = 3; //
/////
SendGift = 4; //
BuyNobility = 5; //
/////
DrawGiftPack = 10; //
CheckIn = 11; //
/////
EventRankSubmit = 20; //
EventBattleEnd = 21; //
/////
Transfer = 30; //
}
enum Goods {
Title = 0; //
Elite = 1; //
}
enum RankType {
Unknown = 0;
Damage = 1; //
DeDamage = 2; //
General = 3; //
DeGeneral = 4; //
KillUnit = 5; //
DeKillUnit = 6; //
KillPlayer = 7; //
DeKillPlayer = 8; //
Win = 9; //
Lost = 10; //
FirstBlood = 11; //
DeFirstBlood = 12; //
}

@ -387,8 +387,8 @@ func (c *NWebsocket) wrapSendMessage(v interface{}) (*Entry, error) {
return msg, nil return msg, nil
} }
// closeAndReConnect 断线重连 // CloseAndReConnect 断线重连
func (c *NWebsocket) closeAndReConnect() { func (c *NWebsocket) CloseAndReConnect() {
if c.Closed() { if c.Closed() {
return return
} }
@ -407,7 +407,7 @@ func (c *NWebsocket) readInternalLoop() {
c.onDisconnected(err) c.onDisconnected(err)
} }
// 断线重连 // 断线重连
c.closeAndReConnect() c.CloseAndReConnect()
return return
} }
entry := &Entry{ entry := &Entry{

Loading…
Cancel
Save