上传做虫子通关奖励

This commit is contained in:
liwei1dao 2023-12-07 16:20:45 +08:00
parent 91a925e04f
commit 548385a562

View File

@ -14,6 +14,8 @@ func (this *apiComp) PassLevel(session comm.IUserSession, req *pb.CatchbugsPassL
var (
conf *cfg.GameCatchbugStageData
info *pb.DBCatchBugs
card int32
ok bool
err error
)
if errdata = this.PassLevelCheck(session, req); errdata != nil {
@ -36,6 +38,14 @@ func (this *apiComp) PassLevel(session comm.IUserSession, req *pb.CatchbugsPassL
}
return
}
for _, v := range req.Card {
if _, ok = info.Books[v]; !ok {
card++
info.Books[v]++
}
}
info.Integral += conf.Points
info.Accruedintegral += conf.Points
info.Level[req.Level] = true
@ -44,6 +54,6 @@ func (this *apiComp) PassLevel(session comm.IUserSession, req *pb.CatchbugsPassL
"accruedintegral": info.Accruedintegral,
"level": info.Level,
})
session.SendMsg(string(this.module.GetType()), "passlevel", &pb.CatchbugsPassLevelResp{Level: req.Level, Integral: info.Integral})
session.SendMsg(string(this.module.GetType()), "passlevel", &pb.CatchbugsPassLevelResp{Level: req.Level, Integral: info.Integral, Accruedintegral: info.Accruedintegral, Card: card})
return
}