任务批量处理

This commit is contained in:
meixiongfeng 2023-03-10 15:47:19 +08:00
parent 158ac69b08
commit 03b846b3f1

View File

@ -91,13 +91,29 @@ func (this *Hero) createRepeatHero(session comm.IUserSession, heroCfgId string,
}
//}(session.GetUserId(), heroCfgId)
// 统计任务
this.ModuleRtask.SendToRtask(session, comm.Rtype1, utils.ToInt32(heroCfgId))
// 查品质
cfg := this.configure.GetHeroConfig(heroCfgId)
if cfg != nil {
this.ModuleRtask.SendToRtask(session, comm.Rtype30, 1, cfg.Color)
this.ModuleRtask.SendToRtask(session, comm.Rtype31, 1, cfg.Color)
// this.ModuleRtask.SendToRtask(session, comm.Rtype1, utils.ToInt32(heroCfgId))
// this.ModuleRtask.SendToRtask(session, comm.Rtype30, 1, cfg.Color)
// this.ModuleRtask.SendToRtask(session, comm.Rtype31, 1, cfg.Color)
var (
szTask []*comm.TaskParam
)
szTask = append(szTask, &comm.TaskParam{
TT: comm.Rtype1,
Params: []int32{utils.ToInt32(heroCfgId)},
})
szTask = append(szTask, &comm.TaskParam{
TT: comm.Rtype30,
Params: []int32{1, cfg.Color},
})
szTask = append(szTask, &comm.TaskParam{
TT: comm.Rtype31,
Params: []int32{1, cfg.Color},
})
this.ModuleRtask.TriggerTask(session.GetUserId(), szTask)
}
return
@ -718,6 +734,9 @@ func (this *Hero) GetAllMaxHero(session comm.IUserSession) (code pb.ErrorCode) {
func (this *Hero) SendTaskMsg(session comm.IUserSession, szStar []int32, drawCount int32, itype bool) {
// 任务统计
var (
szTask []*comm.TaskParam
)
if itype { //普通招募
if drawCount == 10 {
sz := make(map[int32]int32, 0)
@ -725,29 +744,80 @@ func (this *Hero) SendTaskMsg(session comm.IUserSession, szStar []int32, drawCou
sz[star]++
}
for k := range sz {
this.ModuleRtask.SendToRtask(session, comm.Rtype17, 1, k)
szTask = append(szTask, &comm.TaskParam{
TT: comm.Rtype17,
Params: []int32{1, k},
})
//this.ModuleRtask.SendToRtask(session, comm.Rtype17, 1, k)
}
}
this.ModuleRtask.SendToRtask(session, comm.Rtype18, drawCount)
this.ModuleRtask.SendToRtask(session, comm.Rtype141, drawCount)
this.ModuleRtask.SendToRtask(session, comm.Rtype143, drawCount)
this.ModuleRtask.SendToRtask(session, comm.Rtype145, drawCount)
szTask = append(szTask, &comm.TaskParam{
TT: comm.Rtype18,
Params: []int32{drawCount},
})
szTask = append(szTask, &comm.TaskParam{
TT: comm.Rtype141,
Params: []int32{drawCount},
})
szTask = append(szTask, &comm.TaskParam{
TT: comm.Rtype143,
Params: []int32{drawCount},
})
szTask = append(szTask, &comm.TaskParam{
TT: comm.Rtype145,
Params: []int32{drawCount},
})
// this.ModuleRtask.SendToRtask(session, comm.Rtype18, drawCount)
// this.ModuleRtask.SendToRtask(session, comm.Rtype141, drawCount)
// this.ModuleRtask.SendToRtask(session, comm.Rtype143, drawCount)
// this.ModuleRtask.SendToRtask(session, comm.Rtype145, drawCount)
} else { // 阵营招募
this.ModuleRtask.SendToRtask(session, comm.Rtype19, drawCount)
this.ModuleRtask.SendToRtask(session, comm.Rtype142, drawCount)
this.ModuleRtask.SendToRtask(session, comm.Rtype144, drawCount)
this.ModuleRtask.SendToRtask(session, comm.Rtype146, drawCount)
szTask = append(szTask, &comm.TaskParam{
TT: comm.Rtype19,
Params: []int32{drawCount},
})
szTask = append(szTask, &comm.TaskParam{
TT: comm.Rtype142,
Params: []int32{drawCount},
})
szTask = append(szTask, &comm.TaskParam{
TT: comm.Rtype144,
Params: []int32{drawCount},
})
szTask = append(szTask, &comm.TaskParam{
TT: comm.Rtype146,
Params: []int32{drawCount},
})
if drawCount == 10 {
this.ModuleRtask.SendToRtask(session, comm.Rtype91, 1) // 阵营10连
szTask = append(szTask, &comm.TaskParam{
TT: comm.Rtype91,
Params: []int32{1},
})
}
}
for _, star := range szStar {
this.ModuleRtask.SendToRtask(session, comm.Rtype16, star, 1)
szTask = append(szTask, &comm.TaskParam{
TT: comm.Rtype16,
Params: []int32{star, 1},
})
//this.ModuleRtask.SendToRtask(session, comm.Rtype16, star, 1)
}
if drawCount == 10 {
this.ModuleRtask.SendToRtask(session, comm.Rtype90, 1)
szTask = append(szTask, &comm.TaskParam{
TT: comm.Rtype90,
Params: []int32{1},
})
//this.ModuleRtask.SendToRtask(session, comm.Rtype90, 1)
}
this.ModuleRtask.SendToRtask(session, comm.Rtype89, drawCount)
szTask = append(szTask, &comm.TaskParam{
TT: comm.Rtype89,
Params: []int32{drawCount},
})
//this.ModuleRtask.SendToRtask(session, comm.Rtype89, drawCount)
this.ModuleRtask.TriggerTask(session.GetUserId(), szTask)
}
func (this *Hero) newCondition(heroRecord *pb.DBHeroRecord) (get bool, starIndex int32) {