阵营塔红点返回进度信息

This commit is contained in:
meixiongfeng 2023-08-02 18:18:05 +08:00
parent be0037cd3b
commit 6f09e9996f

View File

@ -160,16 +160,19 @@ func (this *Pagoda) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (r
} }
break break
case comm.Reddot29101: case comm.Reddot29101:
activity, process := this.CheckPoint29101(session.GetUserId())
reddot[comm.Reddot29101] = &pb.ReddotItem{ reddot[comm.Reddot29101] = &pb.ReddotItem{
Rid: int32(comm.Reddot29101), Rid: int32(comm.Reddot29101),
Activated: this.CheckPoint29101(session.GetUserId()), Activated: activity,
Progress: process,
} }
break break
} }
} }
return return
} }
func (this *Pagoda) CheckPoint29101(uid string) bool {
func (this *Pagoda) CheckPoint29101(uid string) (activated bool, progress int32) {
var ( var (
curWeekDay int32 //今天周几 curWeekDay int32 //今天周几
) )
@ -179,34 +182,30 @@ func (this *Pagoda) CheckPoint29101(uid string) bool {
} }
list, err := this.modelRacePagoda.getPagodaRaceList(uid) list, err := this.modelRacePagoda.getPagodaRaceList(uid)
if err != nil { if err != nil {
return false return
} }
for _, v := range list.Race { for _, v := range list.Race {
if v.Race < 10 { if v.Race < 10 { // 10以内的是阵营塔
bOpen := false var defeat int32
// 校验今天是否开启 // 校验今天是否开启
if c, err := this.configure.GetPagodaCirculateConf(v.Race, v.Curfloor); err != nil { if c, err := this.configure.GetPagodaCirculateConf(v.Race, v.Curfloor); err != nil {
for _, v := range c.Openingtime { for _, v1 := range c.Openingtime {
if curWeekDay == v { if curWeekDay == v1 {
bOpen = true if utils.IsToday(v.Rtime) {
defeat = v.Defeat
return
}
if defeat < 10 { // 每天固定打10次
progress += (10 - defeat)
activated = true
}
break break
} }
} }
} }
if !bOpen {
break
}
if !utils.IsToday(v.Rtime) {
list.Race[v.Race].Rtime = configure.Now().Unix()
list.Race[v.Race].Defeat = 0
return true
}
if v.Defeat < 10 {
return true
} }
} }
} return
return true
} }
// 红点检测 // 红点检测