From 5b1a020ffa8801bcb3a6e3b81e0847ae51edd09d Mon Sep 17 00:00:00 2001 From: liwei <2211068034@qq.com> Date: Tue, 1 Aug 2023 13:56:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E7=BA=A2=E7=82=B9=E8=BF=9B?= =?UTF-8?q?=E5=BA=A6=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/const.go | 1 + modules/practice/module.go | 35 +++++++++++++++++++++++++++++++++-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/comm/const.go b/comm/const.go index 96352f3af..5d15b1872 100644 --- a/comm/const.go +++ b/comm/const.go @@ -569,6 +569,7 @@ const ( Reddot25101 ReddotType = 25101 // 每日任务进度红点 //武馆 Reddot26101 ReddotType = 26101 // 每日一练 + Reddot26201 ReddotType = 26201 // 今日剩余训练次数:x //云朵签到 Reddot27101 ReddotType = 27101 // 签到进度 //巨怪商队跑商 diff --git a/modules/practice/module.go b/modules/practice/module.go index 83d27086f..78febeed5 100644 --- a/modules/practice/module.go +++ b/modules/practice/module.go @@ -10,6 +10,7 @@ import ( "go_dreamfactory/modules" "go_dreamfactory/pb" "go_dreamfactory/sys/configure" + cfg "go_dreamfactory/sys/configure/structs" "go_dreamfactory/sys/db" "time" @@ -411,14 +412,35 @@ func (this *Practice) GetAllJxRes() (res []string, err error) { // 红点 func (this *Practice) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]*pb.ReddotItem) { var ( - room *pb.DBPracticeRoom - err error + room *pb.DBPracticeRoom + pconf *cfg.GamePandamasMzData + usenum int32 + totalusenum int32 + err error ) reddot = make(map[comm.ReddotType]*pb.ReddotItem) if room, err = this.modelPandata.queryUserMartialhall(session.GetUserId()); err != nil { this.Errorln(err) return } + if room.Pillar1.Isunlock == 2 { + usenum += room.Pillar1.Usenum + if pconf, err = this.configure.getGamePandamasMz(room.Pillar1.Lv); err == nil { + totalusenum += pconf.Limitation + } + } + if room.Pillar2.Isunlock == 2 { + usenum += room.Pillar2.Usenum + if pconf, err = this.configure.getGamePandamasMz(room.Pillar2.Lv); err == nil { + totalusenum += pconf.Limitation + } + } + if room.Pillar3.Isunlock == 2 { + usenum += room.Pillar3.Usenum + if pconf, err = this.configure.getGamePandamasMz(room.Pillar3.Lv); err == nil { + totalusenum += pconf.Limitation + } + } for _, v := range rid { switch v { case comm.Reddot26101: @@ -429,7 +451,16 @@ func (this *Practice) Reddot(session comm.IUserSession, rid ...comm.ReddotType) Total: 1, } break + case comm.Reddot26201: + reddot[comm.Reddot26101] = &pb.ReddotItem{ + Rid: int32(comm.Reddot26101), + Activated: true, + Progress: usenum, + Total: totalusenum, + } + break } + } return }