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 }