Merge branch 'meixiongfeng' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev

This commit is contained in:
meixiongfeng 2022-11-18 10:48:09 +08:00
commit f40c6b9b34
6 changed files with 29 additions and 246 deletions

View File

@ -1,14 +1,4 @@
[ [
{
"index": "1",
"var": [
{
"a": "hero",
"t": "25001",
"n": 5
}
]
},
{ {
"index": "2", "index": "2",
"var": [ "var": [
@ -19,16 +9,6 @@
} }
] ]
}, },
{
"index": "3",
"var": [
{
"a": "hero",
"t": "25004",
"n": 5
}
]
},
{ {
"index": "13", "index": "13",
"var": [ "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", "index": "23",
"var": [ "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", "index": "67",
"var": [ "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", "index": "75",
"var": [ "var": [

View File

@ -36,7 +36,7 @@ type (
QueryHeroAmount(uId string, heroCfgId string) (amount uint32) 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) CreateRepeatHeros(session IUserSession, heros map[string]int32, bPush bool) (code pb.ErrorCode)
// 获取英雄 // 获取英雄

View File

@ -289,3 +289,11 @@ func (this *MCompConfigure) LoadSignData() {
} }
return 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
}

View File

@ -119,6 +119,16 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (code pb.ErrorC
res = append(res, v.Var...) 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) code = this.DispenseRes(session, res, true)
if code != pb.ErrorCode_Success { if code != pb.ErrorCode_Success {
this.Errorf("资源发放失败,%v", code) this.Errorf("资源发放失败,%v", code)

View File

@ -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 newHero, err := this.module.CreateRepeatHero(session, conf.Hero, 1, false); err == pb.ErrorCode_Success {
if err == nil {
ChangeList = append(ChangeList, newHero) ChangeList = append(ChangeList, newHero)
session.SendMsg(string(this.module.GetType()), "change", &pb.HeroChangePush{List: ChangeList}) session.SendMsg(string(this.module.GetType()), "change", &pb.HeroChangePush{List: ChangeList})
} else { } else {

View File

@ -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) _hero, err := this.modelHero.createHeroOverlying(session.GetUserId(), heroCfgId, num)
if err == nil { if err == nil {
go func(uid string, heroCfgId string) { // 携程处理 图鉴数据 go func(uid string, heroCfgId string) { // 携程处理 图鉴数据
if db.IsCross() { if db.IsCross() {
this.moduleFetter.SendRpcAddHero(session, heroCfgId) this.moduleFetter.SendRpcAddHero(session, heroCfgId)
} else { } else {
this.moduleFetter.AddHeroFetterData(uid, heroCfgId) 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 { if result, err1 := this.ModuleUser.GetUserExpand(uid); err1 == nil {
initUpdate := map[string]interface{}{} initUpdate := map[string]interface{}{}
sz := result.GetTujian() sz := result.GetTujian()
@ -244,7 +250,7 @@ func (this *Hero) CreateRepeatHeros(session comm.IUserSession, heros map[string]
if num == 0 { // 数量为0 不做处理 if num == 0 { // 数量为0 不做处理
continue 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) this.Errorf("create hero %s failed", heroCfgId)
} }
} }