From ffe178cd3628431c0d52f288e58dac46544de333 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Thu, 2 Mar 2023 15:44:31 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=A7=A3=E6=9E=90?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/smithy/comp_configure.go | 11 +++++------ modules/smithy/model_atlas.go | 17 +++++++---------- sys/configure/structs/Tables.go | 8 +------- 3 files changed, 13 insertions(+), 23 deletions(-) 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 81d136d3c..ab0b34599 100644 --- a/sys/configure/structs/Tables.go +++ b/sys/configure/structs/Tables.go @@ -167,7 +167,6 @@ type Tables struct { SmithyAtlas *GameSmithyAtlas SmithyAtlasLv *GameSmithyAtlasLv SmithyAtlasScore *GameSmithyAtlasScore - SmithyDrop *GameSmithyDrop } func NewTables(loader JsonLoader) (*Tables, error) { @@ -1111,11 +1110,6 @@ 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 - } - if tables.SmithyDrop, err = NewGameSmithyDrop(buf); err != nil { - return nil, err - } + return tables, nil } From fcb15060c46d5e552b324710d6c2a6e3a191172d Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Thu, 2 Mar 2023 18:05:03 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E9=87=8D=E5=A4=8D=E8=8B=B1=E9=9B=84?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/hero/module.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 }