From b82bcbaf5e85f505b0cd109db3bb89e7a7e00128 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Tue, 20 Dec 2022 17:08:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E9=89=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/hero/module.go | 50 +++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/modules/hero/module.go b/modules/hero/module.go index 7ab66361f..b98e0772b 100644 --- a/modules/hero/module.go +++ b/modules/hero/module.go @@ -68,36 +68,36 @@ func (this *Hero) CreateRepeatHero(session comm.IUserSession, heroCfgId string, var err error hero, err = this.modelHero.createHeroOverlying(session.GetUserId(), heroCfgId, num) if err == nil { - go func(uid string, heroCfgId string) { // 携程处理 图鉴数据 - if db.IsCross() { - this.moduleFetter.SendRpcAddHero(session, heroCfgId) - } else { - this.moduleFetter.AddHeroFetterData(uid, heroCfgId) - } - heroConf := this.modelHero.moduleHero.configure.GetHeroConfig(heroCfgId) - if heroConf == nil { - return + //go func(uid string, heroCfgId string) { // 携程处理 图鉴数据 + if db.IsCross() { + this.moduleFetter.SendRpcAddHero(session, heroCfgId) + } else { + this.moduleFetter.AddHeroFetterData(session.GetUserId(), heroCfgId) + } + heroConf := this.modelHero.moduleHero.configure.GetHeroConfig(heroCfgId) + if heroConf == nil { + return + } + + if result, err1 := this.ModuleUser.GetUserExpand(session.GetUserId()); err1 == nil { + initUpdate := map[string]interface{}{} + sz := result.GetTujian() + if len(sz) == 0 { + sz = make(map[string]int32, 0) } - if result, err1 := this.ModuleUser.GetUserExpand(uid); err1 == nil { - initUpdate := map[string]interface{}{} - sz := result.GetTujian() - if len(sz) == 0 { - sz = make(map[string]int32, 0) + if _, ok := result.GetTujian()[heroCfgId]; !ok { + if heroConf.Handbook == -1 { + sz[heroCfgId] = 0 + } else { + sz[heroCfgId] = 1 } - if _, ok := result.GetTujian()[heroCfgId]; !ok { - if heroConf.Handbook == -1 { - sz[heroCfgId] = 0 - } else { - sz[heroCfgId] = 1 - } - - initUpdate["tujian"] = sz - this.ModuleUser.ChangeUserExpand(uid, initUpdate) - } + initUpdate["tujian"] = sz + this.ModuleUser.ChangeUserExpand(session.GetUserId(), initUpdate) } - }(session.GetUserId(), heroCfgId) + } + //}(session.GetUserId(), heroCfgId) // 统计任务 this.ModuleRtask.SendToRtask(session, comm.Rtype1, utils.ToInt32(heroCfgId)) // 查品质