上传任务优化

This commit is contained in:
liwei 2023-06-17 02:34:12 +08:00
parent a850b4af7a
commit 9b11b68040

View File

@ -152,36 +152,24 @@ func (this *Worldtask) TCondFinishNotify(uid string, conds []*pb.ConIProgress) {
tasks := map[int32][]int32{}
taskgroup := map[int32]int32{}
allconds := []int32{}
for _, cfg := range worldtaskConf.GetDataList() {
for _, condId := range cfg.Completetask {
// for _, cfg := range worldtaskConf.GetDataList() {
for _, group := range userTask.CurrentTasks {
for _, v := range group.TaskMap {
tconfig := worldtaskConf.GetDataMap()[v.TaskId]
for _, condId := range tconfig.Completetask {
for _, cond := range conds {
if condId == cond.Conid { //&& cond.State == pb.BuriedItemFinishState_buried_finish {
tasks[cfg.Key] = cfg.Completetask
taskgroup[cfg.Key] = cfg.Group
allconds = append(allconds, cfg.Completetask...)
//校验任务是否是当前任务
// if task, ok := userTask.CurrentTasks[cfg.Group]; ok {
// tasks[cfg.Key] = cfg.Completetask
// var currentTasks []*pb.CurrentTask
// for _, t := range task.TaskMap {
// if cfg.Key == t.TaskId {
// finishedCondIds = append(finishedCondIds, cond)
// currentTasks = append(currentTasks, &pb.CurrentTask{
// GroupId: cfg.Group,
// TaskId: cfg.Key,
// Conds: finishedCondIds,
// })
// }
// }
// if currentTasks != nil {
// taskConds[cfg.Group] = currentTasks
// }
// }
tasks[tconfig.Key] = tconfig.Completetask
taskgroup[tconfig.Key] = tconfig.Group
allconds = append(allconds, tconfig.Completetask...)
break
}
}
}
}
}
// }
if len(allconds) == 0 {
// this.Debug("未匹配到完成的条件")