From 99bff176d7187ec428aad9a0ec9b999ea868077b Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Fri, 10 Mar 2023 15:58:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E8=B1=A1=E6=B1=A0=E6=8E=A5=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/hero/module.go | 98 +++++++++--------------------------------- 1 file changed, 20 insertions(+), 78 deletions(-) diff --git a/modules/hero/module.go b/modules/hero/module.go index 781238172..199e660f6 100644 --- a/modules/hero/module.go +++ b/modules/hero/module.go @@ -95,24 +95,11 @@ func (this *Hero) createRepeatHero(session comm.IUserSession, heroCfgId string, // 查品质 cfg := this.configure.GetHeroConfig(heroCfgId) if cfg != nil { - // 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}, - }) + + var szTask []*comm.TaskParam + szTask = append(szTask, comm.GettaskParam(comm.Rtype1, utils.ToInt32(heroCfgId))) + szTask = append(szTask, comm.GettaskParam(comm.Rtype30, cfg.Color)) + szTask = append(szTask, comm.GettaskParam(comm.Rtype31, cfg.Color)) this.ModuleRtask.TriggerTask(session.GetUserId(), szTask...) } @@ -744,79 +731,34 @@ func (this *Hero) SendTaskMsg(session comm.IUserSession, szStar []int32, drawCou sz[star]++ } for k := range sz { - szTask = append(szTask, &comm.TaskParam{ - TT: comm.Rtype17, - Params: []int32{1, k}, - }) + szTask = append(szTask, comm.GettaskParam(comm.Rtype17, 1, k)) //this.ModuleRtask.SendToRtask(session, comm.Rtype17, 1, k) } } - 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) + szTask = append(szTask, comm.GettaskParam(comm.Rtype18, drawCount)) + szTask = append(szTask, comm.GettaskParam(comm.Rtype141, drawCount)) + szTask = append(szTask, comm.GettaskParam(comm.Rtype143, drawCount)) + szTask = append(szTask, comm.GettaskParam(comm.Rtype145, drawCount)) + } else { // 阵营招募 - 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}, - }) - + szTask = append(szTask, comm.GettaskParam(comm.Rtype19, drawCount)) + szTask = append(szTask, comm.GettaskParam(comm.Rtype142, drawCount)) + szTask = append(szTask, comm.GettaskParam(comm.Rtype144, drawCount)) + szTask = append(szTask, comm.GettaskParam(comm.Rtype146, drawCount)) if drawCount == 10 { - szTask = append(szTask, &comm.TaskParam{ - TT: comm.Rtype91, - Params: []int32{1}, - }) + szTask = append(szTask, comm.GettaskParam(comm.Rtype91, 1)) } } for _, star := range szStar { - szTask = append(szTask, &comm.TaskParam{ - TT: comm.Rtype16, - Params: []int32{star, 1}, - }) - //this.ModuleRtask.SendToRtask(session, comm.Rtype16, star, 1) + szTask = append(szTask, comm.GettaskParam(comm.Rtype16, star, 1)) } if drawCount == 10 { - szTask = append(szTask, &comm.TaskParam{ - TT: comm.Rtype90, - Params: []int32{1}, - }) - //this.ModuleRtask.SendToRtask(session, comm.Rtype90, 1) + szTask = append(szTask, comm.GettaskParam(comm.Rtype90, 1)) } - szTask = append(szTask, &comm.TaskParam{ - TT: comm.Rtype89, - Params: []int32{drawCount}, - }) - //this.ModuleRtask.SendToRtask(session, comm.Rtype89, drawCount) + + szTask = append(szTask, comm.GettaskParam(comm.Rtype89, drawCount)) this.ModuleRtask.TriggerTask(session.GetUserId(), szTask...) }