Merge branch 'meixiongfeng' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev

This commit is contained in:
meixiongfeng 2022-12-23 16:23:02 +08:00
commit b2484bb1a1
4 changed files with 13 additions and 19 deletions

View File

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

View File

@ -52,14 +52,12 @@ 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, record := this.module.battle.CreatePveBattle(session, &pb.BattlePVEReq{
Ptype: pb.PlayType_hunting,

View File

@ -61,15 +61,15 @@ 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 {
if value == req.Difficulty {
newChallenge = true
} else if value < req.Difficulty {
code = pb.ErrorCode_HuntingLvErr
return
}
newChallenge = true
}
// 校验门票数量够不够
if code = this.module.ConsumeRes(session, []*cfg.Gameatn{costRes}, true); code != pb.ErrorCode_Success {
return
@ -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})

View File

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