diff --git a/bin/json/game_daddy.json b/bin/json/game_daddy.json index 4e5040959..0d3e88987 100644 --- a/bin/json/game_daddy.json +++ b/bin/json/game_daddy.json @@ -1,14 +1,4 @@ [ - { - "index": "1", - "var": [ - { - "a": "hero", - "t": "25001", - "n": 5 - } - ] - }, { "index": "2", "var": [ @@ -19,16 +9,6 @@ } ] }, - { - "index": "3", - "var": [ - { - "a": "hero", - "t": "25004", - "n": 5 - } - ] - }, { "index": "13", "var": [ @@ -89,36 +69,6 @@ } ] }, - { - "index": "19", - "var": [ - { - "a": "hero", - "t": "42911", - "n": 100 - } - ] - }, - { - "index": "20", - "var": [ - { - "a": "hero", - "t": "43911", - "n": 100 - } - ] - }, - { - "index": "21", - "var": [ - { - "a": "hero", - "t": "44911", - "n": 100 - } - ] - }, { "index": "23", "var": [ @@ -399,126 +349,6 @@ } ] }, - { - "index": "51", - "var": [ - { - "a": "hero", - "t": "43921", - "n": 50 - } - ] - }, - { - "index": "52", - "var": [ - { - "a": "hero", - "t": "44921", - "n": 50 - } - ] - }, - { - "index": "53", - "var": [ - { - "a": "hero", - "t": "45921", - "n": 50 - } - ] - }, - { - "index": "54", - "var": [ - { - "a": "hero", - "t": "44006", - "n": 5 - } - ] - }, - { - "index": "55", - "var": [ - { - "a": "hero", - "t": "35001", - "n": 5 - } - ] - }, - { - "index": "56", - "var": [ - { - "a": "hero", - "t": "44005", - "n": 5 - } - ] - }, - { - "index": "57", - "var": [ - { - "a": "hero", - "t": "15004", - "n": 5 - } - ] - }, - { - "index": "59", - "var": [ - { - "a": "hero", - "t": "14007", - "n": 5 - } - ] - }, - { - "index": "60", - "var": [ - { - "a": "hero", - "t": "45003", - "n": 5 - } - ] - }, - { - "index": "61", - "var": [ - { - "a": "hero", - "t": "24004", - "n": 5 - } - ] - }, - { - "index": "65", - "var": [ - { - "a": "hero", - "t": "34006", - "n": 5 - } - ] - }, - { - "index": "66", - "var": [ - { - "a": "hero", - "t": "24003", - "n": 5 - } - ] - }, { "index": "67", "var": [ @@ -529,76 +359,6 @@ } ] }, - { - "index": "68", - "var": [ - { - "a": "hero", - "t": "43901", - "n": 5 - } - ] - }, - { - "index": "69", - "var": [ - { - "a": "hero", - "t": "43902", - "n": 5 - } - ] - }, - { - "index": "70", - "var": [ - { - "a": "hero", - "t": "43903", - "n": 5 - } - ] - }, - { - "index": "71", - "var": [ - { - "a": "hero", - "t": "14003", - "n": 5 - } - ] - }, - { - "index": "72", - "var": [ - { - "a": "hero", - "t": "24002", - "n": 5 - } - ] - }, - { - "index": "73", - "var": [ - { - "a": "hero", - "t": "15005", - "n": 5 - } - ] - }, - { - "index": "74", - "var": [ - { - "a": "hero", - "t": "35003", - "n": 5 - } - ] - }, { "index": "75", "var": [ diff --git a/comm/imodule.go b/comm/imodule.go index 5506cd7a7..9fa563ae3 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -36,7 +36,7 @@ type ( QueryHeroAmount(uId string, heroCfgId string) (amount uint32) //创建指定数量 - CreateRepeatHero(session IUserSession, heroCfgId string, num int32, bPush bool) (code pb.ErrorCode) + CreateRepeatHero(session IUserSession, heroCfgId string, num int32, bPush bool) (hero *pb.DBHero, code pb.ErrorCode) // 批量创建英雄 CreateRepeatHeros(session IUserSession, heros map[string]int32, bPush bool) (code pb.ErrorCode) // 获取英雄 diff --git a/modules/comp_configure.go b/modules/comp_configure.go index 2b0d5f043..0561f265c 100644 --- a/modules/comp_configure.go +++ b/modules/comp_configure.go @@ -289,3 +289,11 @@ func (this *MCompConfigure) LoadSignData() { } return } +func (this *MCompConfigure) GetHeroConfigData() (data []*cfg.GameHeroData) { + if v, err := this.GetConfigure(new_hero); err == nil { + if configure, ok := v.(*cfg.GameHero); ok { + return configure.GetDataList() + } + } + return nil +} diff --git a/modules/gm/module.go b/modules/gm/module.go index 98551806b..d1ea770f1 100644 --- a/modules/gm/module.go +++ b/modules/gm/module.go @@ -119,6 +119,16 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (code pb.ErrorC res = append(res, v.Var...) } + data := this.configure.GetHeroConfigData() + for _, v := range data { + if v.Handbook != -1 { + res = append(res, &cfg.Gameatn{ + A: "hero", + T: v.Hid, + N: 1, + }) + } + } code = this.DispenseRes(session, res, true) if code != pb.ErrorCode_Success { this.Errorf("资源发放失败,%v", code) diff --git a/modules/hero/api_fusion.go b/modules/hero/api_fusion.go index a4b97cd09..718ae94df 100644 --- a/modules/hero/api_fusion.go +++ b/modules/hero/api_fusion.go @@ -72,8 +72,7 @@ func (this *apiComp) Fusion(session comm.IUserSession, req *pb.HeroFusionReq) (c } // 获得新卡 - newHero, err := this.module.modelHero.createHeroOverlying(session.GetUserId(), conf.Hero, 1) - if err == nil { + if newHero, err := this.module.CreateRepeatHero(session, conf.Hero, 1, false); err == pb.ErrorCode_Success { ChangeList = append(ChangeList, newHero) session.SendMsg(string(this.module.GetType()), "change", &pb.HeroChangePush{List: ChangeList}) } else { diff --git a/modules/hero/module.go b/modules/hero/module.go index c08ffa77a..2a64a6a3c 100644 --- a/modules/hero/module.go +++ b/modules/hero/module.go @@ -62,16 +62,22 @@ func (this *Hero) Start() (err error) { } //创建单个叠加英雄 -func (this *Hero) CreateRepeatHero(session comm.IUserSession, heroCfgId string, num int32, bPush bool) (code pb.ErrorCode) { +func (this *Hero) CreateRepeatHero(session comm.IUserSession, heroCfgId string, num int32, bPush bool) (hero *pb.DBHero, code pb.ErrorCode) { _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 + } + if heroConf.Handbook == -1 { // 不需要记录图鉴 + return + } if result, err1 := this.ModuleUser.GetUserExpand(uid); err1 == nil { initUpdate := map[string]interface{}{} sz := result.GetTujian() @@ -244,7 +250,7 @@ func (this *Hero) CreateRepeatHeros(session comm.IUserSession, heros map[string] if num == 0 { // 数量为0 不做处理 continue } - if code = this.CreateRepeatHero(session, heroCfgId, num, bPush); code != pb.ErrorCode_Success { + if _, code = this.CreateRepeatHero(session, heroCfgId, num, bPush); code != pb.ErrorCode_Success { this.Errorf("create hero %s failed", heroCfgId) } }