Commit 178b1b5a authored by hujiebin's avatar hujiebin

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

parent 86bd19b1
......@@ -177,6 +177,7 @@ type RoomInfo struct {
TotalConsume uint64 `json:"totalConsume"`
GameConfig *game_m.GameConfig `json:"gameConfig"`
Owner *user_cv.CvUserDetail `json:"owner"`
EntryEffectType int `json:"entryEffectType"` // 进场特效类型 1: CP 2:神秘人 3:贵族 4:vip
}
type SupportPageDetail struct {
......
......@@ -232,6 +232,9 @@ func (s *GroupService) GroupIn(userId uint64, externalId string, groupUuid strin
NobleLevel uint16 `json:"nobleLevel"`
SvipLevel int `json:"svipLevel"`
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{}
......@@ -246,6 +249,20 @@ func (s *GroupService) GroupIn(userId uint64, externalId string, groupUuid strin
if err != nil {
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{
Nick: user.Nick,
UserAvatar: user.Avatar,
......@@ -257,8 +274,27 @@ func (s *GroupService) GroupIn(userId uint64, externalId string, groupUuid strin
RidReceiverAvatar: properties[rides[userId]].ReceiverAvatar,
NobleLevel: nobleLevel,
Svip: rpc.CopySimpleSvip(svip),
CpLevel: cpLevel,
CpUserAvatar: cpUserAvatar,
}
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)
if err == nil {
......
......@@ -608,6 +608,33 @@ func GetRoomInfo(c *gin.Context) (*mycontext.MyContext, error) {
if err != nil {
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)
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