交付校验修改

This commit is contained in:
wh_zcy 2023-05-30 11:57:20 +08:00
parent b8bc199f37
commit 24fafd65ec
4 changed files with 26 additions and 21 deletions

View File

@ -45,6 +45,10 @@ const (
SociatySubTypeRecommend = "recommend" SociatySubTypeRecommend = "recommend"
) )
const (
SociatyNoFound = "未找到该玩家的公会"
)
type apiComp struct { type apiComp struct {
modules.MCompGate modules.MCompGate
service base.IRPCXService service base.IRPCXService

View File

@ -21,7 +21,8 @@ func (this *apiComp) Accuse(session comm.IUserSession, req *pb.SociatyAccuseReq)
sociaty := this.module.modelSociaty.getUserSociaty(uid) sociaty := this.module.modelSociaty.getUserSociaty(uid)
if sociaty == nil { if sociaty == nil {
code = pb.ErrorCode_SociatyNoFound code = pb.ErrorCode_SociatyNoFound
this.module.Error("当前玩家所在的公会未找到", log.Field{Key: "uid", Value: uid}) data.Datastring = uid
data.Message = SociatyNoFound
return return
} }

View File

@ -5,6 +5,7 @@ import (
"go_dreamfactory/lego/core" "go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/log" "go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"go_dreamfactory/utils"
) )
// 世界任务完成 // 世界任务完成
@ -84,7 +85,6 @@ func (this *apiComp) Finish(session comm.IUserSession, req *pb.WorldtaskFinishRe
log.Field{Key: "uid", Value: uid}, log.Field{Key: "uid", Value: uid},
log.Field{Key: "taskId", Value: req.TaskId}, log.Field{Key: "taskId", Value: req.TaskId},
) )
// finishRsp()
this.module.modelWorldtask.taskFinishPush(session, req.GroupId, userTask, curTaskConf) this.module.modelWorldtask.taskFinishPush(session, req.GroupId, userTask, curTaskConf)
return return
} }
@ -94,14 +94,21 @@ func (this *apiComp) Finish(session comm.IUserSession, req *pb.WorldtaskFinishRe
condiId int32 condiId int32
condiFlag bool condiFlag bool
) )
// 检查当前任务的完成条件
for _, condId := range curTaskConf.Completetask { for _, condId := range curTaskConf.Completetask {
conIds, err := this.module.ModuleBuried.CheckCondition(uid, condId) if v, ok := userTask.CurrentTask[req.GroupId]; ok {
// if this.module.modelWorldtask.checkCondi(uid, condId) { if _, ok := utils.Findx(v.CondiIds, condId); !ok {
if err == nil && len(conIds) > 0 { conIds, err := this.module.ModuleBuried.CheckCondition(uid, condId)
condiFlag = true if err == nil && len(conIds) > 0 {
} else { condiFlag = true
condiFlag = false } else {
condiId = condId condiFlag = false
condiId = condId
}
} else {
condiFlag = true
}
} }
} }

View File

@ -98,9 +98,9 @@ func (this *Worldtask) TCondFinishNotify(uid string, conids []int32) {
} }
if len(finishedTaskIds) == 0 { if len(finishedTaskIds) == 0 {
// this.Debug("未找到通知的世界任务", // this.Debug("未找到当前世界任务",
// log.Field{Key: "uid", Value: uid}, // log.Field{Key: "uid", Value: uid},
// log.Field{Key: "finishedTaskIds", Value: finishedTaskIds}) // log.Field{Key: "finishedTaskIds", Value: finishedTaskIds})
return return
} }
@ -113,16 +113,9 @@ func (this *Worldtask) TCondFinishNotify(uid string, conids []int32) {
wt = &pb.Worldtask{} wt = &pb.Worldtask{}
} }
for _, condId := range conids { for _, condId := range finishedCondIds {
if _, ok := utils.Findx(wt.CondiIds, condId); !ok { if _, ok := utils.Findx(wt.CondiIds, condId); !ok {
condIds, err := this.ModuleBuried.CheckCondition(uid, condId) wt.CondiIds = append(wt.CondiIds, condId)
if err != nil {
this.Error("完成条件校验错误", log.Field{Key: "condId", Value: condId})
return
}
if len(condIds) == 1 && condIds[0] == condId {
wt.CondiIds = append(wt.CondiIds, condId)
}
} }
} }