From dbba6a9af9ddab67b5e69f2c16deb22c3b8a6c49 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Fri, 9 Sep 2022 18:13:24 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8B=A9=E7=8C=8E=E5=8F=AA=E6=9C=89=E6=8C=91?= =?UTF-8?q?=E6=88=98=E6=96=B0=E5=85=B3=E5=8D=A1=E6=89=8D=E5=86=99=E6=8E=92?= =?UTF-8?q?=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/hunting/api_challengeover.go | 15 +++++++++++++-- modules/hunting/model_rank.go | 11 ++++++++--- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/modules/hunting/api_challengeover.go b/modules/hunting/api_challengeover.go index fadc62d1e..e389d4d14 100644 --- a/modules/hunting/api_challengeover.go +++ b/modules/hunting/api_challengeover.go @@ -63,9 +63,20 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha } hunting.Boss[req.BossType] += 1 mapData["boss"] = hunting.Boss - //hunting.BossTime[] = 0 // todo 耗时 mapData["challengeTime"] = hunting.BossTime - this.module.modulerank.updatehuntingRankList(session, req.Difficulty, req.BossType) + if req.Report != nil && len(req.Report.Info.Redflist) > 0 { + sz := make([]*pb.LineUp, 5) + for i, v := range req.Report.Info.Redflist[0].Team { + if v != nil { + sz[i] = &pb.LineUp{ + Cid: v.HeroID, + Star: v.Star, + Lv: v.Lv, + } + } + } + this.module.modulerank.updatehuntingRankList(session, req.Difficulty, req.BossType, req.Report.Info.Redflist[0].Leadpos, sz) + } } // 耗时校验 当前战斗胜利时间消耗小于之前刷新数据 hunting.ChallengeCount++ diff --git a/modules/hunting/model_rank.go b/modules/hunting/model_rank.go index d5a16dc48..4b6717cde 100644 --- a/modules/hunting/model_rank.go +++ b/modules/hunting/model_rank.go @@ -60,7 +60,7 @@ func (this *ModelRank) getHuntingRankList(uid string) []*pb.DBHuntingRank { return ranks } -func (this *ModelRank) updatehuntingRankList(session comm.IUserSession, difficulty int32, boosType int32) { +func (this *ModelRank) updatehuntingRankList(session comm.IUserSession, difficulty int32, boosType int32, Leadpos int32, line []*pb.LineUp) { // 查询是不是更新数据 ranks := this.getHuntingRankList(session.GetUserId()) bfind := false @@ -69,6 +69,9 @@ func (this *ModelRank) updatehuntingRankList(session comm.IUserSession, difficul mapRankData := make(map[string]interface{}, 0) mapRankData["difficulty"] = difficulty mapRankData["bosstype"] = boosType + mapRankData["Leadpos"] = Leadpos + mapRankData["line"] = line + mapRankData["costTime"] = 123 this.ChangeUserRank(session.GetUserId(), v.Id, mapRankData) bfind = true break @@ -76,7 +79,7 @@ func (this *ModelRank) updatehuntingRankList(session comm.IUserSession, difficul } if !bfind { userinfo := this.moduleHunting.ModuleUser.GetUser(session.GetUserId()) - new := &pb.DBHuntingRank{ + new := &pb.DBVikingRank{ Id: primitive.NewObjectID().Hex(), Uid: session.GetUserId(), Difficulty: difficulty, @@ -84,7 +87,9 @@ func (this *ModelRank) updatehuntingRankList(session comm.IUserSession, difficul Nickname: userinfo.Name, Icon: "", Lv: userinfo.Lv, - CostTime: 111, + Leadpos: Leadpos, + Line: line, + CostTime: 12, } this.AddList(session.GetUserId(), new.Id, new) }