上传主线任务领奖代码优化
This commit is contained in:
parent
9a8af78c3f
commit
f499c8dc2b
@ -20,6 +20,7 @@ func (this *apiComp) TaskChapteReward(session comm.IUserSession, req *pb.Mainlin
|
|||||||
conf *cfg.GameMainChapterData
|
conf *cfg.GameMainChapterData
|
||||||
|
|
||||||
award []*pb.UserAtno
|
award []*pb.UserAtno
|
||||||
|
ok bool
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if errdata = this.TaskChapteRewardCheck(session, req); errdata != nil {
|
if errdata = this.TaskChapteRewardCheck(session, req); errdata != nil {
|
||||||
@ -52,26 +53,17 @@ func (this *apiComp) TaskChapteReward(session comm.IUserSession, req *pb.Mainlin
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if taskids := this.module.configure.getgroupTasks(req.Chapteid); len(taskids) > 0 {
|
if taskids := this.module.configure.getgroupTasks(req.Chapteid); len(taskids) > 0 {
|
||||||
|
tids := make([]int32, 0)
|
||||||
for _, v := range taskids {
|
for _, v := range taskids {
|
||||||
if _, progress, err := this.module.ModuleBuried.CheckCondition(session, v.Taskid); err == nil {
|
tids = append(tids, v.Taskid)
|
||||||
for _, v := range progress {
|
}
|
||||||
if v.State == pb.BuriedItemFinishState_buried_unfinish {
|
if ok, _, _ = this.module.ModuleBuried.CheckCondition(session, tids...); !ok {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_ReqParameterError,
|
Code: pb.ErrorCode_ReqParameterError,
|
||||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||||
Message: "task no finish",
|
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
|
|
||||||
}
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
} else { // 配置出错
|
} else { // 配置出错
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
|
Loading…
Reference in New Issue
Block a user