From 548385a562a7db93f21da9f8bd89c9e91bbc442b Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Thu, 7 Dec 2023 16:20:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=81=9A=E8=99=AB=E5=AD=90?= =?UTF-8?q?=E9=80=9A=E5=85=B3=E5=A5=96=E5=8A=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/catchbugs/api_passlevel.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/catchbugs/api_passlevel.go b/modules/catchbugs/api_passlevel.go index 1c665bf91..601eb75a4 100644 --- a/modules/catchbugs/api_passlevel.go +++ b/modules/catchbugs/api_passlevel.go @@ -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 }