This commit is contained in:
meixiongfeng 2022-12-16 18:40:12 +08:00
parent 7c08f2e1bc
commit 840aae0caf
3 changed files with 20 additions and 2 deletions

View File

@ -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

View File

@ -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())
// 普通塔通关了

View File

@ -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)