viking boss类型校验

This commit is contained in:
meixiongfeng 2022-09-02 17:24:07 +08:00
parent 66997a30ca
commit 455952d877

View File

@ -41,10 +41,11 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.VikingChalleng
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
return return
} }
// 类型校验
boosData := this.configure.GetVikingBossConfigData(req.BossType, req.Difficulty)
if boosData != nil {
if value, ok := viking.Boos[req.BossType]; !ok { // 类型校验 if value, ok := viking.Boos[req.BossType]; !ok { // 类型校验
code = pb.ErrorCode_VikingBoosType viking.Boos[req.BossType] = 0
return
} else {
if value < req.Difficulty { if value < req.Difficulty {
if value+1 != req.Difficulty { if value+1 != req.Difficulty {
code = pb.ErrorCode_VikingLvErr code = pb.ErrorCode_VikingLvErr
@ -55,6 +56,7 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.VikingChalleng
newChallenge = false newChallenge = false
} }
} }
}
if newChallenge { // 新关卡挑战通过 发放首通奖励 if newChallenge { // 新关卡挑战通过 发放首通奖励
if code = this.module.DispenseRes(session, cfg.Firstprize, true); code != pb.ErrorCode_Success { if code = this.module.DispenseRes(session, cfg.Firstprize, true); code != pb.ErrorCode_Success {