上传每日任务红点逻辑代码

This commit is contained in:
liwei1dao 2023-09-27 16:55:17 +08:00
parent 7bfc28c5a5
commit 226f149d62
5 changed files with 19 additions and 4 deletions

View File

@ -122,6 +122,7 @@ func (this *Dailytask) Reddot(session comm.IUserSession, rid ...comm.ReddotType)
for _, v := range rid {
switch v {
case comm.Reddot25101:
for _, v := range dtask.Groups {
if v.Complete {
progress++
@ -133,6 +134,9 @@ func (this *Dailytask) Reddot(session comm.IUserSession, rid ...comm.ReddotType)
Progress: progress,
Total: int32(len(dtask.Groups)),
}
if len(dtask.Groups) == 0 {
reddot[comm.Reddot25101].Activated = false
}
break
}
}

View File

@ -101,8 +101,8 @@ func (this *GuildGve) Reddot(session comm.IUserSession, rid ...comm.ReddotType)
for _, v := range rid {
switch v {
case comm.Reddot15301:
reddot[comm.Reddot26101] = &pb.ReddotItem{
Rid: int32(comm.Reddot26101),
reddot[comm.Reddot15301] = &pb.ReddotItem{
Rid: int32(comm.Reddot15301),
Activated: true,
Progress: member.Boosticket,
}

View File

@ -14,7 +14,7 @@ func (this *apiComp) GetGymBuffCheck(session comm.IUserSession, req *pb.Practice
return
}
// /练功请求
//练功请求
func (this *apiComp) GetGymBuff(session comm.IUserSession, req *pb.PracticeGetGymBuffReq) (errdata *pb.ErrorData) {
var (
mryl *cfg.GamePandamasMrylData

View File

@ -13,7 +13,7 @@ func (this *apiComp) GymInfoCheck(session comm.IUserSession, req *pb.PracticeGym
return
}
// /获取每日一练信息
//获取每日一练信息
func (this *apiComp) GymInfo(session comm.IUserSession, req *pb.PracticeGymInfoReq) (errdata *pb.ErrorData) {
var (
err error

View File

@ -434,6 +434,7 @@ func (this *Practice) Reddot(session comm.IUserSession, rid ...comm.ReddotType)
model *pandataModel
room *pb.DBPracticeRoom
pconf *cfg.GamePandamasMzData
userex *pb.DBUserExpand
usenum int32
totalusenum int32
err error
@ -469,12 +470,22 @@ func (this *Practice) Reddot(session comm.IUserSession, rid ...comm.ReddotType)
for _, v := range rid {
switch v {
case comm.Reddot26101:
if userex, err = this.ModuleUser.GetUserExpand(session.GetUserId()); err != nil {
this.Errorln(err)
return
}
reddot[comm.Reddot26101] = &pb.ReddotItem{
Rid: int32(comm.Reddot26101),
Activated: true,
Progress: room.Gymrefresh,
Total: 1,
}
if userex.Globalbuff == 0 {
reddot[comm.Reddot26101].Progress = 0
} else {
reddot[comm.Reddot26101].Progress = 1
}
break
case comm.Reddot26201:
if totalusenum > 0 {