根据配置表中数据来判断是否需要记录图鉴数据
This commit is contained in:
parent
48935873b0
commit
1f4cc5aa8c
@ -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)
|
||||||
// 获取英雄
|
// 获取英雄
|
||||||
|
@ -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 {
|
||||||
|
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user