From 03b846b3f115761b1d7404003eb69b00a39d6102 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Fri, 10 Mar 2023 15:47:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=89=B9=E9=87=8F=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/hero/module.go | 104 ++++++++++++++++++++++++++++++++++------- 1 file changed, 87 insertions(+), 17 deletions(-) diff --git a/modules/hero/module.go b/modules/hero/module.go index e1ee8d508..51d59052a 100644 --- a/modules/hero/module.go +++ b/modules/hero/module.go @@ -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) {