From 8195cb6a76391e666c092902ebe7e9d5b3d868a8 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Fri, 23 Dec 2022 16:21:15 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8B=A9=E7=8C=8E=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/enchant/api_challengeover.go | 2 +- modules/hunting/api_challenge.go | 8 +++----- modules/hunting/api_challengeover.go | 18 ++++++++---------- modules/hunting/module.go | 4 +--- 4 files changed, 13 insertions(+), 19 deletions(-) diff --git a/modules/enchant/api_challengeover.go b/modules/enchant/api_challengeover.go index 3bafdab5b..85db026b8 100644 --- a/modules/enchant/api_challengeover.go +++ b/modules/enchant/api_challengeover.go @@ -91,7 +91,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.EnchantCha } } - mapData["challengeTime"] = enchant.BossTime + mapData["bossTime"] = enchant.BossTime mapData["boss"] = enchant.Boss code = this.module.ModifyEnchantData(session.GetUserId(), mapData) session.SendMsg(string(this.module.GetType()), EnchantChallengeOverResp, &pb.EnchantChallengeOverResp{Data: enchant}) diff --git a/modules/hunting/api_challenge.go b/modules/hunting/api_challenge.go index cd959e961..02fa65518 100644 --- a/modules/hunting/api_challenge.go +++ b/modules/hunting/api_challenge.go @@ -52,13 +52,11 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.HuntingChallen } value, ok := hunting.Boss[req.BossType] if !ok { // 类型校验 - hunting.Boss[req.BossType] = 0 + hunting.Boss[req.BossType] = 1 } if value < req.Difficulty { - if value+1 != req.Difficulty { - code = pb.ErrorCode_HuntingLvErr - return - } + code = pb.ErrorCode_HuntingLvErr + return } code, record := this.module.battle.CreatePveBattle(session, &pb.BattlePVEReq{ diff --git a/modules/hunting/api_challengeover.go b/modules/hunting/api_challengeover.go index d33f990ba..f315e8d51 100644 --- a/modules/hunting/api_challengeover.go +++ b/modules/hunting/api_challengeover.go @@ -61,14 +61,14 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha } value, ok := hunting.Boss[req.BossType] if !ok { // 类型校验 - hunting.Boss[req.BossType] = 0 + hunting.Boss[req.BossType] = 1 } - if value < req.Difficulty { - if value+1 != req.Difficulty { - code = pb.ErrorCode_HuntingLvErr - return - } + if value == req.Difficulty { + newChallenge = true + } else if value < req.Difficulty { + code = pb.ErrorCode_HuntingLvErr + return } // 校验门票数量够不够 if code = this.module.ConsumeRes(session, []*cfg.Gameatn{costRes}, true); code != pb.ErrorCode_Success { @@ -104,10 +104,8 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha mapData["boss"] = hunting.Boss } - for k := range hunting.Boss { - hunting.Boss[k] += 1 - } - mapData["challengeTime"] = hunting.BossTime + + mapData["bossTime"] = hunting.BossTime code = this.module.ModifyHuntingData(session.GetUserId(), mapData) session.SendMsg(string(this.module.GetType()), HuntingChallengeOverResp, &pb.HuntingChallengeOverResp{Data: hunting}) diff --git a/modules/hunting/module.go b/modules/hunting/module.go index 782718506..69a9f7f8b 100644 --- a/modules/hunting/module.go +++ b/modules/hunting/module.go @@ -173,9 +173,7 @@ func (this *Hunting) CompleteAllLevel(session comm.IUserSession) (code pb.ErrorC } mapData["boss"] = list.Boss code = this.ModifyHuntingData(session.GetUserId(), mapData) - for k := range list.Boss { - list.Boss[k] += 1 - } + session.SendMsg(string(this.GetType()), HuntingGetListResp, &pb.HuntingGetListResp{Data: list}) return }