diff --git a/modules/hero/module.go b/modules/hero/module.go index e982e1765..c8c8d73b6 100644 --- a/modules/hero/module.go +++ b/modules/hero/module.go @@ -101,7 +101,10 @@ func (this *Hero) createRepeatHero(session comm.IUserSession, heroCfgId string, return } - code = pb.ErrorCode_HeroCreate + if err != nil { + code = pb.ErrorCode_HeroCreate + } + return } diff --git a/modules/smithy/comp_configure.go b/modules/smithy/comp_configure.go index 606739706..64402a3c4 100644 --- a/modules/smithy/comp_configure.go +++ b/modules/smithy/comp_configure.go @@ -34,7 +34,7 @@ type configureComp struct { _mapProficile map[int64]*cfg.GameSmithyProficiencyData // 熟练度 key 卷轴ID+ 等级 _mapskill map[int64]*cfg.GameSmithyToolData // 熟练度 key 技能类型+ 技能等级等级 - _mapAtlasScore map[int64]*cfg.GameSmithyAtlasScoreData // 图鉴积分 + _mapAtlasScore map[int64]int32 // 图鉴积分 //_dropMap map[int32][]*cfg.GameSmithyDropData // 掉落表 key 是DiropId } @@ -62,8 +62,7 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp configure.RegisterConfigure(game_smproficiency, cfg.NewGameSmithyProficiency, this.LoadProficileData) this._mapskill = make(map[int64]*cfg.GameSmithyToolData, 0) configure.RegisterConfigure(game_smithytools, cfg.NewGameSmithyTool, this.LoadSmithySkillData) - - this._mapAtlasScore = make(map[int64]*cfg.GameSmithyAtlasScoreData, 0) + this._mapAtlasScore = make(map[int64]int32, 0) configure.RegisterConfigure(game_smithyatlasscore, cfg.NewGameSmithyAtlasScore, this.LoadSmithyAtlasScoreConf) err = this.LoadConfigure(game_smithyreel, cfg.NewGameNewSmithy) err = this.LoadConfigure(game_smithystove, cfg.NewGameSmithyStoveV1) @@ -72,7 +71,6 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp err = this.LoadConfigure(game_smithycustomer, cfg.NewGameSmithyCustomer) err = this.LoadConfigure(game_smithyatlas, cfg.NewGameSmithyAtlas) err = this.LoadConfigure(game_smithyatlaslv, cfg.NewGameSmithyAtlasLv) - err = this.LoadConfigure(game_smithyatlasscore, cfg.NewGameSmithyAtlasScore) err = this.LoadConfigure(game_smithytask, cfg.NewGameSmithyTask) // this._dropMap = make(map[int32][]*cfg.GameSmithyDropData, 0) @@ -277,7 +275,7 @@ func (this *configureComp) GetSmithyAtlasLvConf(lv int32) (data *cfg.GameSmithyA return } -func (this *configureComp) GetSmithyAtlasScoreConf(quality int32, lv int32) (data *cfg.GameSmithyAtlasScoreData) { +func (this *configureComp) GetSmithyAtlasScoreConf(quality int32, lv int32) (score int32) { return this._mapAtlasScore[int64(quality<<16)+int64(lv)] } @@ -286,9 +284,10 @@ func (this *configureComp) LoadSmithyAtlasScoreConf() { if v, err := this.GetConfigure(game_smithyatlasscore); err == nil { if configure, ok := v.(*cfg.GameSmithyAtlasScore); ok { this.hlock.Lock() + this._mapAtlasScore = make(map[int64]int32, 0) defer this.hlock.Unlock() for _, value := range configure.GetDataList() { - this._mapAtlasScore[int64(value.Quality<<16)+int64(value.Lv)] = value + this._mapAtlasScore[int64(value.Quality<<16)+int64(value.Lv)] = value.Score } return } diff --git a/modules/smithy/model_atlas.go b/modules/smithy/model_atlas.go index e1054b7a9..90c2bd6d4 100644 --- a/modules/smithy/model_atlas.go +++ b/modules/smithy/model_atlas.go @@ -67,10 +67,7 @@ func (this *modelAtlas) CheckActivateAtlas(uid string, id string, lv int32, qual return false } if atlasConf.TypeId == 1 { // 装备收藏图鉴信息 - scoreConf := this.module.configure.GetSmithyAtlasScoreConf(quality, lv) - if scoreConf == nil { - return false - } + atlasScore := this.module.configure.GetSmithyAtlasScoreConf(quality, lv) update := make(map[string]interface{}, 0) if v, ok := list.Atlas[id]; ok { // 找到相同的 if v.Activate { // 已经激活的 @@ -79,24 +76,24 @@ func (this *modelAtlas) CheckActivateAtlas(uid string, id string, lv int32, qual ForgeCount: forgeCount, Lv: lv, Quality: quality, - Score: scoreConf.Score, + Score: atlasScore, Time: configure.Now().Unix(), } } else { - if v.Data2.Score < scoreConf.Score { + if v.Data2.Score < atlasScore { v.Data2.ForgeCount = forgeCount v.Data2.Lv = lv v.Data2.Quality = quality - v.Data2.Score = scoreConf.Score + v.Data2.Score = atlasScore v.Data2.Time = configure.Now().Unix() } } } else { // 没有激活的 - if v.Data1.Score < scoreConf.Score { + if v.Data1.Score < atlasScore { v.Data1.ForgeCount = forgeCount v.Data1.Lv = lv v.Data1.Quality = quality - v.Data1.Score = scoreConf.Score + v.Data1.Score = atlasScore v.Data1.Time = configure.Now().Unix() } v.Data2 = nil @@ -107,7 +104,7 @@ func (this *modelAtlas) CheckActivateAtlas(uid string, id string, lv int32, qual ForgeCount: forgeCount, Lv: lv, Quality: quality, - Score: scoreConf.Score, + Score: atlasScore, Time: configure.Now().Unix(), }, Data2: nil, diff --git a/sys/configure/structs/Tables.go b/sys/configure/structs/Tables.go index cbd192ced..1d4612332 100644 --- a/sys/configure/structs/Tables.go +++ b/sys/configure/structs/Tables.go @@ -1110,8 +1110,5 @@ func NewTables(loader JsonLoader) (*Tables, error) { if tables.SmithyAtlasScore, err = NewGameSmithyAtlasScore(buf); err != nil { return nil, err } - if buf, err = loader("game_smithydrop"); err != nil { - return nil, err - } return tables, nil }