From f499c8dc2ba096a2b052e126a18eefbe5638c3d8 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Tue, 16 Jan 2024 09:53:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E4=B8=BB=E7=BA=BF=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E9=A2=86=E5=A5=96=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/mainline/api_taskchaptereward.go | 28 +++++++++--------------- 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/modules/mainline/api_taskchaptereward.go b/modules/mainline/api_taskchaptereward.go index 093a56c7d..2be65280c 100644 --- a/modules/mainline/api_taskchaptereward.go +++ b/modules/mainline/api_taskchaptereward.go @@ -20,6 +20,7 @@ func (this *apiComp) TaskChapteReward(session comm.IUserSession, req *pb.Mainlin conf *cfg.GameMainChapterData award []*pb.UserAtno + ok bool err error ) if errdata = this.TaskChapteRewardCheck(session, req); errdata != nil { @@ -52,26 +53,17 @@ func (this *apiComp) TaskChapteReward(session comm.IUserSession, req *pb.Mainlin return } if taskids := this.module.configure.getgroupTasks(req.Chapteid); len(taskids) > 0 { + tids := make([]int32, 0) for _, v := range taskids { - if _, progress, err := this.module.ModuleBuried.CheckCondition(session, v.Taskid); err == nil { - for _, v := range progress { - if v.State == pb.BuriedItemFinishState_buried_unfinish { - errdata = &pb.ErrorData{ - Code: pb.ErrorCode_ReqParameterError, - Title: pb.ErrorCode_ReqParameterError.ToString(), - Message: "task no finish", - } - return - } - } - } else { - errdata = &pb.ErrorData{ - Code: pb.ErrorCode_ExternalModule, - Title: pb.ErrorCode_ExternalModule.ToString(), - Message: comm.NewExternalModuleErr("Buried", "CheckCondition", v.Taskid).Error(), - } - return + tids = append(tids, v.Taskid) + } + if ok, _, _ = this.module.ModuleBuried.CheckCondition(session, tids...); !ok { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + Message: "task no finish", } + return } } else { // 配置出错 errdata = &pb.ErrorData{