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 }