From 1f84d4e9e0d017e7d4c598b7aaabca319d6bfc4f Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Mon, 5 Feb 2024 10:50:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E6=8B=9F=E6=8A=BD=E4=B8=8D=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E8=8B=B1=E9=9B=84=E5=AE=9E=E4=BE=8B=E5=AF=B9=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/hero/model_hero.go | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/modules/hero/model_hero.go b/modules/hero/model_hero.go index e4ec05417..5cf600a62 100644 --- a/modules/hero/model_hero.go +++ b/modules/hero/model_hero.go @@ -953,6 +953,9 @@ func (this *ModelHero) createHero(session comm.IUserSession, heroCfgId string, c N: 1, O: hero.Id, }) + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.ModuleEntertain.AddXxlCard(session, map[string]int32{hero.HeroID: 1}, true) + }) } res := make([]*cfg.Gameatn, 0) rst, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()) @@ -1137,7 +1140,11 @@ func (this *ModelHero) ImitateHeros(session comm.IUserSession, cids []string, bI if bFirst { // 没有当前英雄 if bImitate { - hero = this.InitHero(uid, heroCfgId) + // 模拟英雄不用真实数据 + hero = &pb.DBHero{ + HeroID: heroCfgId, + } + //hero = this.InitHero(uid, heroCfgId) } else { hero, err = this.initHeroOverlying(uid, heroCfgId, 1) } @@ -1203,18 +1210,16 @@ func (this *ModelHero) ImitateHeros(session comm.IUserSession, cids []string, bI } addres = append(addres, res) } - if !bImitate && bChange { - this.module.ModuleUser.ChangeUserExpand(session.GetUserId(), map[string]interface{}{ - "herofrag": rst.Herofrag, - "expitem": rst.Expitem, - }) - } - if !bImitate { // 获得三消卡片资源数据 + if !bImitate { go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { - this.module.ModuleEntertain.AddXxlCard(session, szCard, true) - }) + if bChange { + this.module.ModuleUser.ChangeUserExpand(session.GetUserId(), map[string]interface{}{ + "herofrag": rst.Herofrag, + "expitem": rst.Expitem, + }) + } } return }