From 6f09e9996ff83282f0a66abaa368cf972dc2d9d6 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Wed, 2 Aug 2023 18:18:05 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=B5=E8=90=A5=E5=A1=94=E7=BA=A2=E7=82=B9?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E8=BF=9B=E5=BA=A6=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/pagoda/module.go | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/modules/pagoda/module.go b/modules/pagoda/module.go index 03ce50de2..1d1c5003e 100644 --- a/modules/pagoda/module.go +++ b/modules/pagoda/module.go @@ -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 } // 红点检测