From 840aae0caf91fddaa92c675ce418eb7fa081ce23 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Fri, 16 Dec 2022 18:40:12 +0800 Subject: [PATCH] update --- modules/hero/api_talentlist.go | 2 +- modules/pagoda/api_challengeover.go | 14 +++++++++++++- modules/pagoda/model_rank.go | 6 ++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/modules/hero/api_talentlist.go b/modules/hero/api_talentlist.go index a8e8b0ecd..ced66ce4c 100644 --- a/modules/hero/api_talentlist.go +++ b/modules/hero/api_talentlist.go @@ -20,7 +20,7 @@ func (this *apiComp) TalentList(session comm.IUserSession, req *pb.HeroTalentLis rsp := &pb.HeroTalentListResp{} if rsp.Telnet, err = this.module.modelTalent.GetHerotalent(session.GetUserId()); err != nil { fmt.Printf("GetHerotalenterr: %v\n", err) - code = pb.ErrorCode_DBError + //code = pb.ErrorCode_DBError } session.SendMsg(string(this.module.GetType()), HeroTalentListResp, rsp) return diff --git a/modules/pagoda/api_challengeover.go b/modules/pagoda/api_challengeover.go index 808f55fae..8299e3701 100644 --- a/modules/pagoda/api_challengeover.go +++ b/modules/pagoda/api_challengeover.go @@ -99,7 +99,19 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PagodaChal } else { this.module.Errorf("no found userdata uid:%s", session.GetUserId()) } - + userinfo := this.module.ModuleUser.GetUser(session.GetUserId()) + newData := &pb.DBPagodaRecord{ + Id: primitive.NewObjectID().Hex(), + Uid: session.GetUserId(), + PagodaId: pagoda.PagodaId, + Type: pagoda.Type, + Nickname: userinfo.Name, + Icon: "", // icon 暂无 + Lv: userinfo.Lv, + CostTime: req.Report.Costtime, + } + costTime = newData.CostTime + this.module.modulerank.AddPagodaRecord(session.GetUserId(), newData) //this.module.modulerank.SetNormalPagodaRankList("pagodaRank", pagoda.PagodaId<<16-costTime, session.GetUserId()) // 普通塔通关了 diff --git a/modules/pagoda/model_rank.go b/modules/pagoda/model_rank.go index 9d90ae04b..e4ebb1abb 100644 --- a/modules/pagoda/model_rank.go +++ b/modules/pagoda/model_rank.go @@ -39,6 +39,12 @@ func (this *ModelRank) GetRankData() (data []*pb.DBPagodaRecord, err error) { return } + +func (this *ModelRank) AddPagodaRecord(uid string, record *pb.DBPagodaRecord) (err error) { + err = this.AddList(uid, record.Id, record) + return +} + func (this *ModelRank) getPagodaRankList(uid string) []*pb.DBPagodaRecord { pagodaRank := make([]*pb.DBPagodaRecord, 0) err := this.GetList(uid, &pagodaRank)