修复多次推送的问题
This commit is contained in:
parent
55e58931ec
commit
189a1c9526
@ -64,7 +64,7 @@ func (this *Worldtask) TaskCondFinishNotify(session comm.IUserSession, condId in
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
var groupId int32
|
var groupId, taskId int32
|
||||||
// 检索condId是否是世界任务的完成条件
|
// 检索condId是否是世界任务的完成条件
|
||||||
finishedTaskIds := make(map[int32]int32) //达成的任务条件
|
finishedTaskIds := make(map[int32]int32) //达成的任务条件
|
||||||
for _, c := range this.worldtaskConf.GetDataList() {
|
for _, c := range this.worldtaskConf.GetDataList() {
|
||||||
@ -72,6 +72,7 @@ func (this *Worldtask) TaskCondFinishNotify(session comm.IUserSession, condId in
|
|||||||
if v == condId {
|
if v == condId {
|
||||||
finishedTaskIds[c.Group] = c.Key
|
finishedTaskIds[c.Group] = c.Key
|
||||||
groupId = c.Group
|
groupId = c.Group
|
||||||
|
taskId = c.Key
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -101,14 +102,12 @@ func (this *Worldtask) TaskCondFinishNotify(session comm.IUserSession, condId in
|
|||||||
}
|
}
|
||||||
this.modelWorldtask.Change(uid, update)
|
this.modelWorldtask.Change(uid, update)
|
||||||
|
|
||||||
for k, v := range userTask.CurrentTask {
|
|
||||||
session.SendMsg(string(this.GetType()), "completecondis", &pb.WorldtaskCompletecondisPush{
|
session.SendMsg(string(this.GetType()), "completecondis", &pb.WorldtaskCompletecondisPush{
|
||||||
GroupId: k,
|
GroupId: groupId,
|
||||||
TaskId: v.TaskId,
|
TaskId: taskId,
|
||||||
CondiIds: wt.CondiIds,
|
CondiIds: wt.CondiIds,
|
||||||
})
|
})
|
||||||
this.Debug("推送完成条件", log.Field{Key: "condiIds", Value: v.TaskId})
|
this.Debug("推送完成条件", log.Field{Key: "condiIds", Value: taskId})
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user