From 0a2e582149db3c9745c4245b50b120253880760b Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Mon, 14 Nov 2022 18:51:44 +0800 Subject: [PATCH] =?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/hero/api_fusion.go | 9 ++++++--- modules/hero/api_talentlist.go | 9 ++++++++- modules/privilege/configure.go | 2 +- modules/timer/season.go | 1 - modules/troll/module.go | 2 +- sys/db/dbmodel.go | 2 +- 6 files changed, 17 insertions(+), 8 deletions(-) diff --git a/modules/hero/api_fusion.go b/modules/hero/api_fusion.go index a0d9bf381..a4b97cd09 100644 --- a/modules/hero/api_fusion.go +++ b/modules/hero/api_fusion.go @@ -70,13 +70,16 @@ func (this *apiComp) Fusion(session comm.IUserSession, req *pb.HeroFusionReq) (c } ChangeList = append(ChangeList, _costMaphero[k]) } + // 获得新卡 newHero, err := this.module.modelHero.createHeroOverlying(session.GetUserId(), conf.Hero, 1) if err == nil { - session.SendMsg(string(this.module.GetType()), HeroFusionResp, &pb.HeroFusionResp{Heroid: conf.Hero}) ChangeList = append(ChangeList, newHero) + session.SendMsg(string(this.module.GetType()), "change", &pb.HeroChangePush{List: ChangeList}) + } else { + this.module.Errorf("err:%v,create hero:%s,uid,%ss", err, conf.Hero, session.GetUserId()) + code = pb.ErrorCode_HeroCreate // 创建新英雄失败 } - session.SendMsg(string(this.module.GetType()), "change", &pb.HeroChangePush{List: ChangeList}) - + session.SendMsg(string(this.module.GetType()), HeroFusionResp, &pb.HeroFusionResp{Heroid: conf.Hero}) return } diff --git a/modules/hero/api_talentlist.go b/modules/hero/api_talentlist.go index 3782526d8..a8e8b0ecd 100644 --- a/modules/hero/api_talentlist.go +++ b/modules/hero/api_talentlist.go @@ -1,6 +1,7 @@ package hero import ( + "fmt" "go_dreamfactory/comm" "go_dreamfactory/pb" @@ -13,8 +14,14 @@ func (this *apiComp) TalentListCheck(session comm.IUserSession, req *pb.HeroTale } func (this *apiComp) TalentList(session comm.IUserSession, req *pb.HeroTalentListReq) (code pb.ErrorCode, data proto.Message) { + var ( + err error + ) rsp := &pb.HeroTalentListResp{} - rsp.Telnet, _ = this.module.modelTalent.GetHerotalent(session.GetUserId()) + if rsp.Telnet, err = this.module.modelTalent.GetHerotalent(session.GetUserId()); err != nil { + fmt.Printf("GetHerotalenterr: %v\n", err) + code = pb.ErrorCode_DBError + } session.SendMsg(string(this.module.GetType()), HeroTalentListResp, rsp) return } diff --git a/modules/privilege/configure.go b/modules/privilege/configure.go index f9c1e8392..e7f8b29ea 100644 --- a/modules/privilege/configure.go +++ b/modules/privilege/configure.go @@ -38,7 +38,7 @@ func (this *configureComp) GetPrivilegeCard(id string) (configure *cfg.GamePrivi return } else { if configure, ok = v.(*cfg.GamePrivilegeCard).GetDataMap()[id]; !ok { - err = fmt.Errorf("GamePrivilegeCardData not found:%d ", id) + err = fmt.Errorf("GamePrivilegeCardData not found:%s ", id) this.module.Errorf("err:%v", err) return } diff --git a/modules/timer/season.go b/modules/timer/season.go index 6c7388233..d4738a070 100644 --- a/modules/timer/season.go +++ b/modules/timer/season.go @@ -165,7 +165,6 @@ func (this *SeasonPagoda) TimerSeasonOver() { func (this *SeasonPagoda) TimerSeasonStar() { this.module.Debugf("TimerSeasonStar:%d", configure.Now().Unix()) //star := configure.Now() - if !db.IsCross() { // 删除本服的赛季塔数据 conn, err := db.Cross() // 获取跨服的链接对象 if err == nil { diff --git a/modules/troll/module.go b/modules/troll/module.go index d7c603bb5..c2ac4e591 100644 --- a/modules/troll/module.go +++ b/modules/troll/module.go @@ -186,7 +186,7 @@ func (this *Troll) SellAllItem(uid string, troll *pb.DBTrollTrain, price map[int troll.Price = make(map[int32]int32, 0) // 原来的价格也清除 troll.GridNum = 0 // 清空格子 // 写统计 - if gold > 0 { + if gold != 0 { this.record.AddTrollRecord(uid, gold, tarinPos) } diff --git a/sys/db/dbmodel.go b/sys/db/dbmodel.go index 20caa25a9..bf4d007b9 100644 --- a/sys/db/dbmodel.go +++ b/sys/db/dbmodel.go @@ -279,7 +279,7 @@ func (this *DBModel) ChangeList(uid string, _id string, data map[string]interfac if option.IsMgoLog { if uid == "" { err = this.UpdateModelLogs(this.TableName, uid, bson.M{"_id": _id}, data) - }else{ + } else { err = this.UpdateModelLogs(this.TableName, uid, bson.M{"_id": _id, "uid": uid}, data) } }