上传红点进度信息

This commit is contained in:
liwei 2023-08-01 13:56:24 +08:00
parent 75d72cd542
commit 5b1a020ffa
2 changed files with 34 additions and 2 deletions

View File

@ -569,6 +569,7 @@ const (
Reddot25101 ReddotType = 25101 // 每日任务进度红点 Reddot25101 ReddotType = 25101 // 每日任务进度红点
//武馆 //武馆
Reddot26101 ReddotType = 26101 // 每日一练 Reddot26101 ReddotType = 26101 // 每日一练
Reddot26201 ReddotType = 26201 // 今日剩余训练次数x
//云朵签到 //云朵签到
Reddot27101 ReddotType = 27101 // 签到进度 Reddot27101 ReddotType = 27101 // 签到进度
//巨怪商队跑商 //巨怪商队跑商

View File

@ -10,6 +10,7 @@ import (
"go_dreamfactory/modules" "go_dreamfactory/modules"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"go_dreamfactory/sys/configure" "go_dreamfactory/sys/configure"
cfg "go_dreamfactory/sys/configure/structs"
"go_dreamfactory/sys/db" "go_dreamfactory/sys/db"
"time" "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) { func (this *Practice) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]*pb.ReddotItem) {
var ( var (
room *pb.DBPracticeRoom room *pb.DBPracticeRoom
err error pconf *cfg.GamePandamasMzData
usenum int32
totalusenum int32
err error
) )
reddot = make(map[comm.ReddotType]*pb.ReddotItem) reddot = make(map[comm.ReddotType]*pb.ReddotItem)
if room, err = this.modelPandata.queryUserMartialhall(session.GetUserId()); err != nil { if room, err = this.modelPandata.queryUserMartialhall(session.GetUserId()); err != nil {
this.Errorln(err) this.Errorln(err)
return 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 { for _, v := range rid {
switch v { switch v {
case comm.Reddot26101: case comm.Reddot26101:
@ -429,7 +451,16 @@ func (this *Practice) Reddot(session comm.IUserSession, rid ...comm.ReddotType)
Total: 1, Total: 1,
} }
break break
case comm.Reddot26201:
reddot[comm.Reddot26101] = &pb.ReddotItem{
Rid: int32(comm.Reddot26101),
Activated: true,
Progress: usenum,
Total: totalusenum,
}
break
} }
} }
return return
} }