红点::29101 种族塔 今日剩余可挑战关卡

This commit is contained in:
meixiongfeng 2023-08-02 15:36:21 +08:00
parent 420d583445
commit a1f533fa45
3 changed files with 68 additions and 24 deletions

View File

@ -584,6 +584,7 @@ const (
Reddot28101 ReddotType = 28101 // 剩余车票
//种族塔
Reddot29101 ReddotType = 29101 // 今日剩余可挑战关卡x
)
type TaskType int32

View File

@ -21,10 +21,10 @@ func (this *apiComp) ChallengeRaceCheck(session comm.IUserSession, req *pb.Pagod
// /阵营塔开始挑战
func (this *apiComp) ChallengeRace(session comm.IUserSession, req *pb.PagodaChallengeRaceReq) (errdata *pb.ErrorData) {
var (
pagoda *pb.DBPagodaRace
err error
//timeCheckOk bool
pType pb.PlayType
pagoda *pb.DBPagodaRace
err error
timeCheckOk bool
pType pb.PlayType
)
if errdata = this.ChallengeRaceCheck(session, req); errdata != nil {
return // 参数校验失败直接返回
@ -40,24 +40,24 @@ func (this *apiComp) ChallengeRace(session comm.IUserSession, req *pb.PagodaChal
return
}
// 判断开启时间
// curWeekDay := int32(configure.Now().Weekday())
// if curWeekDay == 0 {
// curWeekDay = 7
// }
// for _, v := range conf.Openingtime {
// if v == curWeekDay {
// timeCheckOk = true
// break
// }
// }
// if !timeCheckOk {
// errdata = &pb.ErrorData{
// Code: pb.ErrorCode_PagodaTimeError,
// Title: pb.ErrorCode_PagodaTimeError.ToString(),
// }
// return
// }
//判断开启时间
curWeekDay := int32(configure.Now().Weekday())
if curWeekDay == 0 {
curWeekDay = 7
}
for _, v := range conf.Openingtime {
if v == curWeekDay {
timeCheckOk = true
break
}
}
if !timeCheckOk {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_PagodaTimeError,
Title: pb.ErrorCode_PagodaTimeError.ToString(),
}
return
}
pagoda, err = this.module.modelRacePagoda.getPagodaRaceList(session.GetUserId())
if err != nil {
errdata = &pb.ErrorData{

View File

@ -159,12 +159,55 @@ func (this *Pagoda) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (r
Activated: this.CheckPoint6(session.GetUserId()),
}
break
case comm.Reddot29101:
reddot[comm.Reddot29101] = &pb.ReddotItem{
Rid: int32(comm.Reddot29101),
Activated: this.CheckPoint29101(session.GetUserId()),
}
break
}
}
return
}
func (this *Pagoda) CheckPoint29101(uid string) bool {
var (
curWeekDay int32 //今天周几
)
curWeekDay = int32(configure.Now().Weekday())
if curWeekDay == 0 {
curWeekDay = 7
}
list, err := this.modelRacePagoda.getPagodaRaceList(uid)
if err != nil {
return false
}
for _, v := range list.Race {
if v.Race < 10 {
bOpen := false
// 校验今天是否开启
if c, err := this.configure.GetPagodaCirculateConf(v.Race, v.Curfloor); err != nil {
for _, v := range c.Openingtime {
if curWeekDay == v {
bOpen = 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
}
// 红点检测
func (this *Pagoda) CheckPoint6(uid string) bool {