From a54a70ce83921bd28fffb341e19f7075b57f096a Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Fri, 10 Mar 2023 16:44:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AF=E5=BC=82=E6=AD=A5=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/api_strengthenUpSkill.go | 22 +++++++++++-------- modules/hero/api_strengthenUpStar.go | 19 ++++++++++------ modules/hero/model_hero.go | 31 +++++++++++++++------------ modules/hero/module.go | 5 ++--- 4 files changed, 45 insertions(+), 32 deletions(-) diff --git a/modules/hero/api_strengthenUpSkill.go b/modules/hero/api_strengthenUpSkill.go index ed7487a06..721078bf3 100644 --- a/modules/hero/api_strengthenUpSkill.go +++ b/modules/hero/api_strengthenUpSkill.go @@ -116,25 +116,29 @@ func (this *apiComp) StrengthenUpSkill(session comm.IUserSession, req *pb.HeroSt } else { this.module.Errorf("no found userdata uid:%s", session.GetUserId()) } - this.module.ModuleRtask.SendToRtask(session, comm.Rtype52, utils.ToInt32(_hero.HeroID), 1) - this.module.ModuleRtask.SendToRtask(session, comm.Rtype53, 1) + + // 推送 世界任务消息 + var szTask []*comm.TaskParam + szTask = append(szTask, comm.GettaskParam(comm.Rtype52, utils.ToInt32(_hero.HeroID), 1)) + szTask = append(szTask, comm.GettaskParam(comm.Rtype53, 1)) + // 检查是不是满级技能 maxLv := true for _, skill := range _hero.NormalSkill { skillMaxLv := this.module.configure.GetHeroSkillMaxLvConfig(uint32(skill.SkillID)) if skill.SkillLv < skillMaxLv { // 找到没有满级的技能id maxLv = false + break } } if maxLv { - - this.module.ModuleRtask.SendToRtask(session, comm.Rtype54, 1) - this.module.ModuleRtask.SendToRtask(session, comm.Rtype57, 1) + szTask = append(szTask, comm.GettaskParam(comm.Rtype54, 1)) + szTask = append(szTask, comm.GettaskParam(comm.Rtype57, 1)) } - cfg := this.module.configure.GetHeroConfig(_hero.HeroID) - if cfg != nil { - this.module.ModuleRtask.SendToRtask(session, comm.Rtype55, cfg.Color, 1) - this.module.ModuleRtask.SendToRtask(session, comm.Rtype56, 1, 1, cfg.Job) + if cfg := this.module.configure.GetHeroConfig(_hero.HeroID); cfg != nil { + szTask = append(szTask, comm.GettaskParam(comm.Rtype55, cfg.Color, 1)) + szTask = append(szTask, comm.GettaskParam(comm.Rtype56, 1, 1, cfg.Job)) } + go this.module.ModuleRtask.TriggerTask(session.GetUserId(), szTask...) return } diff --git a/modules/hero/api_strengthenUpStar.go b/modules/hero/api_strengthenUpStar.go index 0d4d2d782..c83f3f09a 100644 --- a/modules/hero/api_strengthenUpStar.go +++ b/modules/hero/api_strengthenUpStar.go @@ -83,15 +83,22 @@ func (this *apiComp) StrengthenUpStar(session comm.IUserSession, req *pb.HeroStr } else { this.module.Errorf("no found userdata uid:%s", session.GetUserId()) } - this.module.ModuleRtask.SendToRtask(session, comm.Rtype6, utils.ToInt32(_hero.HeroID), _hero.Star) - this.module.ModuleRtask.SendToRtask(session, comm.Rtype25, 1, utils.ToInt32(_hero.HeroID), _hero.Star) + + // 推送 世界任务消息 + var szTask []*comm.TaskParam + szTask = append(szTask, comm.GettaskParam(comm.Rtype6, utils.ToInt32(_hero.HeroID), _hero.Star)) + szTask = append(szTask, comm.GettaskParam(comm.Rtype25, 1, utils.ToInt32(_hero.HeroID), _hero.Star)) + if _hero.Star == 4 { - this.module.ModuleRtask.SendToRtask(session, comm.Rtype26, 1) + szTask = append(szTask, comm.GettaskParam(comm.Rtype26, 1)) + } else if _hero.Star == 5 { - this.module.ModuleRtask.SendToRtask(session, comm.Rtype27, 1) + szTask = append(szTask, comm.GettaskParam(comm.Rtype27, 1)) } else if _hero.Star == 6 { - this.module.ModuleRtask.SendToRtask(session, comm.Rtype28, 1) + szTask = append(szTask, comm.GettaskParam(comm.Rtype28, 1)) } - this.module.ModuleRtask.SendToRtask(session, comm.Rtype115, utils.ToInt32(_hero.HeroID), _hero.Star) + szTask = append(szTask, comm.GettaskParam(comm.Rtype115, utils.ToInt32(_hero.HeroID), _hero.Star)) + go this.module.ModuleRtask.TriggerTask(session.GetUserId(), szTask...) + // this.module.ModuleRtask.SendToRtask(session, comm.Rtype115, utils.ToInt32(_hero.HeroID), _hero.Star) return } diff --git a/modules/hero/model_hero.go b/modules/hero/model_hero.go index 3be2b5d2a..367746b65 100644 --- a/modules/hero/model_hero.go +++ b/modules/hero/model_hero.go @@ -572,27 +572,30 @@ func (this *ModelHero) AddCardExp(session comm.IUserSession, hero *pb.DBHero, ex } if curLv-preLv > 0 { // 升级了 统计任务 - // 推送 - this.moduleHero.ModuleRtask.SendToRtask(session, comm.Rtype147, utils.ToInt32(hero.HeroID), curLv-preLv) - this.moduleHero.ModuleRtask.SendToRtask(session, comm.Rtype113, utils.ToInt32(hero.HeroID), curLv-preLv) - this.moduleHero.ModuleRtask.SendToRtask(session, comm.Rtype4, utils.ToInt32(hero.HeroID), hero.Lv) - this.moduleHero.ModuleRtask.SendToRtask(session, comm.Rtype23, 1, hero.Star, hero.Lv) - this.moduleHero.ModuleRtask.SendToRtask(session, comm.Rtype24, 1) - this.moduleHero.ModuleRtask.SendToRtask(session, comm.Rtype29, 1, hero.Lv, utils.ToInt32(hero.HeroID)) - cfg := this.moduleHero.configure.GetHeroConfig(hero.HeroID) - if cfg != nil { - this.moduleHero.ModuleRtask.SendToRtask(session, comm.Rtype32, 1, cfg.Color, hero.Lv) - this.moduleHero.ModuleRtask.SendToRtask(session, comm.Rtype36, 1, cfg.Color, cfg.Job, cfg.Race, hero.JuexingLv) + var szTask []*comm.TaskParam + szTask = append(szTask, comm.GettaskParam(comm.Rtype147, utils.ToInt32(hero.HeroID), curLv-preLv)) + szTask = append(szTask, comm.GettaskParam(comm.Rtype113, utils.ToInt32(hero.HeroID), curLv-preLv)) + szTask = append(szTask, comm.GettaskParam(comm.Rtype4, utils.ToInt32(hero.HeroID), hero.Lv)) + szTask = append(szTask, comm.GettaskParam(comm.Rtype23, 1, hero.Star, hero.Lv)) + szTask = append(szTask, comm.GettaskParam(comm.Rtype24, 1)) + szTask = append(szTask, comm.GettaskParam(comm.Rtype29, 1, hero.Lv, utils.ToInt32(hero.HeroID))) + + if cfg := this.moduleHero.configure.GetHeroConfig(hero.HeroID); cfg != nil { + szTask = append(szTask, comm.GettaskParam(comm.Rtype32, 1, cfg.Color, hero.Lv)) + szTask = append(szTask, comm.GettaskParam(comm.Rtype36, 1, cfg.Color, cfg.Job, cfg.Race, hero.JuexingLv)) + //xx英雄满级、共鸣、觉醒至最高状态 nextAwaken := this.moduleHero.configure.GetHeroAwakenConfig(hero.HeroID, hero.JuexingLv+1) if nextAwaken == nil { // 达到满级觉醒 if hero.Lv == this.moduleHero.configure.GetHeroMaxLv(hero.Star) { - this.moduleHero.ModuleRtask.SendToRtask(session, comm.Rtype37, 1, cfg.Color) - this.moduleHero.ModuleRtask.SendToRtask(session, comm.Rtype38, 1) + szTask = append(szTask, comm.GettaskParam(comm.Rtype37, 1, cfg.Color)) + szTask = append(szTask, comm.GettaskParam(comm.Rtype38, 1)) } } } - this.moduleHero.ModuleRtask.SendToRtask(session, comm.Rtype33, 1, 1, hero.Lv) + szTask = append(szTask, comm.GettaskParam(comm.Rtype33, 1, 1, hero.Lv)) + go this.moduleHero.ModuleRtask.TriggerTask(session.GetUserId(), szTask...) + //this.moduleHero.ModuleRtask.SendToRtask(session, comm.Rtype33, 1, 1, hero.Lv) } } return diff --git a/modules/hero/module.go b/modules/hero/module.go index 199e660f6..87b6f5ea1 100644 --- a/modules/hero/module.go +++ b/modules/hero/module.go @@ -95,12 +95,11 @@ func (this *Hero) createRepeatHero(session comm.IUserSession, heroCfgId string, // 查品质 cfg := this.configure.GetHeroConfig(heroCfgId) if cfg != nil { - 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...) + go this.ModuleRtask.TriggerTask(session.GetUserId(), szTask...) } return @@ -759,7 +758,7 @@ func (this *Hero) SendTaskMsg(session comm.IUserSession, szStar []int32, drawCou } szTask = append(szTask, comm.GettaskParam(comm.Rtype89, drawCount)) - this.ModuleRtask.TriggerTask(session.GetUserId(), szTask...) + go this.ModuleRtask.TriggerTask(session.GetUserId(), szTask...) } func (this *Hero) newCondition(heroRecord *pb.DBHeroRecord) (get bool, starIndex int32) {