阵营塔红点返回进度信息
This commit is contained in:
parent
be0037cd3b
commit
6f09e9996f
@ -160,16 +160,19 @@ func (this *Pagoda) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (r
|
||||
}
|
||||
break
|
||||
case comm.Reddot29101:
|
||||
activity, process := this.CheckPoint29101(session.GetUserId())
|
||||
reddot[comm.Reddot29101] = &pb.ReddotItem{
|
||||
Rid: int32(comm.Reddot29101),
|
||||
Activated: this.CheckPoint29101(session.GetUserId()),
|
||||
Activated: activity,
|
||||
Progress: process,
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
func (this *Pagoda) CheckPoint29101(uid string) bool {
|
||||
|
||||
func (this *Pagoda) CheckPoint29101(uid string) (activated bool, progress int32) {
|
||||
var (
|
||||
curWeekDay int32 //今天周几
|
||||
)
|
||||
@ -179,34 +182,30 @@ func (this *Pagoda) CheckPoint29101(uid string) bool {
|
||||
}
|
||||
list, err := this.modelRacePagoda.getPagodaRaceList(uid)
|
||||
if err != nil {
|
||||
return false
|
||||
return
|
||||
}
|
||||
for _, v := range list.Race {
|
||||
if v.Race < 10 {
|
||||
bOpen := false
|
||||
if v.Race < 10 { // 10以内的是阵营塔
|
||||
var defeat int32
|
||||
// 校验今天是否开启
|
||||
if c, err := this.configure.GetPagodaCirculateConf(v.Race, v.Curfloor); err != nil {
|
||||
for _, v := range c.Openingtime {
|
||||
if curWeekDay == v {
|
||||
bOpen = true
|
||||
for _, v1 := range c.Openingtime {
|
||||
if curWeekDay == v1 {
|
||||
if utils.IsToday(v.Rtime) {
|
||||
defeat = v.Defeat
|
||||
return
|
||||
}
|
||||
if defeat < 10 { // 每天固定打10次
|
||||
progress += (10 - defeat)
|
||||
activated = true
|
||||
}
|
||||
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 true
|
||||
return
|
||||
}
|
||||
|
||||
// 红点检测
|
||||
|
Loading…
Reference in New Issue
Block a user