Commit 178b1b5a authored by hujiebin's avatar hujiebin

进场特效类型 1: CP 2:神秘人 3:贵族 4:vip

parent 86bd19b1
...@@ -166,17 +166,18 @@ type RoomInfo struct { ...@@ -166,17 +166,18 @@ type RoomInfo struct {
ThemeId uint64 `json:"themeId"` ThemeId uint64 `json:"themeId"`
ThemeUrl string `json:"themeUrl"` ThemeUrl string `json:"themeUrl"`
// 1:官方 2:自定义 // 1:官方 2:自定义
ThemeType uint8 `json:"themeType"` ThemeType uint8 `json:"themeType"`
Role group_e.GroupRoleType `json:"role"` Role group_e.GroupRoleType `json:"role"`
DiceNum uint16 `json:"diceNum"` // 骰子游戏的数量 DiceNum uint16 `json:"diceNum"` // 骰子游戏的数量
DiceType uint16 `json:"diceType"` // 骰子游戏类型 DiceType uint16 `json:"diceType"` // 骰子游戏类型
RoleMembers []SimpleRoleInfo `json:"roleMembers"` RoleMembers []SimpleRoleInfo `json:"roleMembers"`
WelcomeText string `json:"welcomeText"` // 新成员入群欢迎语 WelcomeText string `json:"welcomeText"` // 新成员入群欢迎语
Banners []BannerElement `json:"banners"` Banners []BannerElement `json:"banners"`
LuckyWheel LuckyWheelState `json:"luckyWheel"` LuckyWheel LuckyWheelState `json:"luckyWheel"`
TotalConsume uint64 `json:"totalConsume"` TotalConsume uint64 `json:"totalConsume"`
GameConfig *game_m.GameConfig `json:"gameConfig"` GameConfig *game_m.GameConfig `json:"gameConfig"`
Owner *user_cv.CvUserDetail `json:"owner"` Owner *user_cv.CvUserDetail `json:"owner"`
EntryEffectType int `json:"entryEffectType"` // 进场特效类型 1: CP 2:神秘人 3:贵族 4:vip
} }
type SupportPageDetail struct { type SupportPageDetail struct {
......
...@@ -232,6 +232,9 @@ func (s *GroupService) GroupIn(userId uint64, externalId string, groupUuid strin ...@@ -232,6 +232,9 @@ func (s *GroupService) GroupIn(userId uint64, externalId string, groupUuid strin
NobleLevel uint16 `json:"nobleLevel"` NobleLevel uint16 `json:"nobleLevel"`
SvipLevel int `json:"svipLevel"` SvipLevel int `json:"svipLevel"`
Svip rpc.CvSvip `json:"svip"` Svip rpc.CvSvip `json:"svip"`
CpLevel int `json:"cpLevel"` // cp等级
CpUserAvatar string `json:"cpUserAvatar"` // cp用户头像
EntryEffectType int `json:"entryEffectType"` // 进场特效类型 1: CP 2:神秘人 3:贵族 4:vip
} }
up := user_m.UserProperty{} up := user_m.UserProperty{}
...@@ -246,6 +249,20 @@ func (s *GroupService) GroupIn(userId uint64, externalId string, groupUuid strin ...@@ -246,6 +249,20 @@ func (s *GroupService) GroupIn(userId uint64, externalId string, groupUuid strin
if err != nil { if err != nil {
return err return err
} }
var cpLevel int
var cpUserAvatar string
var cpEntryEffect bool
if cp, _ := rpc.GetUserCp(model, userId); cp != nil {
cpLevel = cp.CpLevel.Level
if cp.CpUserInfo.Avatar != nil {
cpUserAvatar = *cp.CpUserInfo.Avatar
}
for _, v := range cp.MyPrivilegeList {
if v.Type == 5 {
cpEntryEffect = true
}
}
}
r := UserParam{ r := UserParam{
Nick: user.Nick, Nick: user.Nick,
UserAvatar: user.Avatar, UserAvatar: user.Avatar,
...@@ -257,8 +274,27 @@ func (s *GroupService) GroupIn(userId uint64, externalId string, groupUuid strin ...@@ -257,8 +274,27 @@ func (s *GroupService) GroupIn(userId uint64, externalId string, groupUuid strin
RidReceiverAvatar: properties[rides[userId]].ReceiverAvatar, RidReceiverAvatar: properties[rides[userId]].ReceiverAvatar,
NobleLevel: nobleLevel, NobleLevel: nobleLevel,
Svip: rpc.CopySimpleSvip(svip), Svip: rpc.CopySimpleSvip(svip),
CpLevel: cpLevel,
CpUserAvatar: cpUserAvatar,
} }
rideId = r.RideId rideId = r.RideId
// 进场特效类型
var entryEffectType int // 进场特效类型 1: CP 2:神秘人 3:贵族 4:vip ,顺序从小到大
if r.IsVip {
entryEffectType = 4
}
if r.NobleLevel > 0 {
entryEffectType = 3
}
for _, v := range r.Svip.Privileges {
if len(v.MysteryCode) > 0 {
entryEffectType = 2
}
}
if cpEntryEffect {
entryEffectType = 1
}
r.EntryEffectType = entryEffectType
buf, err := json.Marshal(r) buf, err := json.Marshal(r)
if err == nil { if err == nil {
......
...@@ -608,6 +608,33 @@ func GetRoomInfo(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -608,6 +608,33 @@ func GetRoomInfo(c *gin.Context) (*mycontext.MyContext, error) {
if err != nil { if err != nil {
model.Log.Errorf("GetRoomInfo: GetUserBase: %s", err.Error()) model.Log.Errorf("GetRoomInfo: GetUserBase: %s", err.Error())
} }
// 进场特效类型
var entryEffectType int // 进场特效类型 1: CP 2:神秘人 3:贵族 4:vip ,顺序从小到大
if result.Owner != nil {
var cpEntryEffect bool
if cp, _ := rpc.GetUserCp(model, userId); cp != nil {
for _, v := range cp.MyPrivilegeList {
if v.Type == 5 {
cpEntryEffect = true
}
}
}
if result.Owner.IsVip {
entryEffectType = 4
}
if result.Owner.Noble.Level > 0 {
entryEffectType = 3
}
for _, v := range result.Owner.Svip.Privileges {
if len(v.MysteryCode) > 0 {
entryEffectType = 2
}
}
if cpEntryEffect {
entryEffectType = 1
}
result.EntryEffectType = entryEffectType
}
resp.ResponseOk(c, result) resp.ResponseOk(c, result)
return myContext, nil return myContext, nil
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment