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