初始养成数据
This commit is contained in:
parent
3447e7ac63
commit
c86bf2c37a
@ -30,6 +30,7 @@ type configureComp struct {
|
||||
play map[string]*cfg.GameDragonPlayData
|
||||
mount map[string]*cfg.GameBuzkashiMountData
|
||||
lvItem map[string]*cfg.GameDragonLvItemData
|
||||
attribute map[string]struct{}
|
||||
}
|
||||
|
||||
// 组件初始化接口
|
||||
@ -153,10 +154,14 @@ func (this *configureComp) LoadDragonLvItem() {
|
||||
if v, err := this.GetConfigure(game_dragonlvitem); err == nil {
|
||||
this.hlock.Lock()
|
||||
defer this.hlock.Unlock()
|
||||
this.attribute = make(map[string]struct{}, 0)
|
||||
this.lvItem = make(map[string]*cfg.GameDragonLvItemData)
|
||||
if _configure, ok := v.(*cfg.GameDragonLvItem); ok {
|
||||
for _, v := range _configure.GetDataList() {
|
||||
this.lvItem[v.Attribute+"-"+strconv.Itoa(int(v.Lv))] = v
|
||||
if _, ok := this.attribute[v.Attribute]; !ok {
|
||||
this.attribute[v.Attribute] = struct{}{}
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
@ -176,3 +181,10 @@ func (this *configureComp) GetDragonLvItemConf(attribute string, lv int32) (conf
|
||||
err = comm.NewNotFoundConfErr(moduleName, dragon_trainlv, fmt.Sprintf("id:%s,lv:%d", attribute, lv))
|
||||
return
|
||||
}
|
||||
|
||||
func (this *configureComp) GetDragonAttributeConf() (conf map[string]struct{}) {
|
||||
|
||||
this.hlock.RLock()
|
||||
defer this.hlock.RUnlock()
|
||||
return this.attribute
|
||||
}
|
||||
|
@ -122,6 +122,9 @@ func (this *ModelDragon) CreateDragon(session comm.IUserSession, dragons map[str
|
||||
if !bNewDragon {
|
||||
continue
|
||||
}
|
||||
for k := range this.module.configure.GetDragonAttributeConf() {
|
||||
dragon.Lvitem[k] = 1
|
||||
}
|
||||
|
||||
if dbModel != nil {
|
||||
err = dbModel.AddList(uid, dragon.Id, dragon)
|
||||
|
Loading…
Reference in New Issue
Block a user