更新bingo世界任务

This commit is contained in:
wh_zcy 2022-12-08 18:05:29 +08:00
parent 1829a454fb
commit bb01b9059f

View File

@ -162,7 +162,39 @@ func (this *Worldtask) GetMyWorldtask(uid string) *pb.DBWorldtask {
}
func (this *Worldtask) BingoAllTask(session comm.IUserSession) error {
return nil
uid := session.GetUserId()
mytask := &pb.DBWorldtask{}
mytask.LastTaskIds = make(map[int32]*pb.Worldtask)
tasklist := this.worldtaskConf.GetDataList()
// 更新数据
update := map[string]interface{}{}
for _, conf := range tasklist {
//世界任务配置
if conf.Des == 2 {
wt := &pb.Worldtask{
TaskId: conf.Key,
TaskType: conf.Des,
}
mytask.LastTaskIds[conf.Group] = wt
mytask.TaskList = append(mytask.TaskList, wt)
}
}
update = map[string]interface{}{
"lastTaskIds": mytask.LastTaskIds,
"taskList": mytask.TaskList,
}
if err := this.modelWorldtask.Change(uid, update); err != nil {
return err
}
rsp := &pb.WorldtaskFinishIdsPush{
TaskList: mytask.TaskList,
}
return session.SendMsg(string(this.GetType()), "finishids", rsp)
}
// bingo世界任务跳跃 支持回退