ソースを参照

战力检测代码bug修复

lt 1 年間 前
コミット
3bc9c9853e

+ 31 - 21
RO_Server_Trunk-branch_0.1.39/roserver/game/model/role_battle.go

@@ -7,7 +7,6 @@ import (
 	"roserver/baseserver/model"
 	"roserver/baseserver/set"
 	"roserver/serverproto"
-	"strings"
 )
 
 func (this *Role) Income() {
@@ -1124,11 +1123,11 @@ func (this *RoleBattle) BossReward(challengeTime uint32, mapId, mapLevel uint32,
 	//		return ret
 	//	}
 	//}
+	isHard := this.role.isHardFight
 	ret := this.bossRewardCheck(challengeTime, mapId, mapLevel)
 	if ret != serverproto.ErrorCode_ERROR_OK {
 		return ret
 	}
-	isHard := this.role.isHardFight
 	levelId := this.getLevelId(this.mapId, this.mapLevel)
 	if isHard {
 		levelId = this.getLevelId(this.mapIdHard, this.mapLevelHard)
@@ -1286,34 +1285,45 @@ func (this *RoleBattle) bossRewardCheck(challengeTime uint32, mapId, mapLevel ui
 		return serverproto.ErrorCode_ERROR_BATTLE_LEVEL_CD_TIME
 	}
 	this.isChallengeBegin = false
-
-	//发送的关卡ID不合法(重发协议)
-	if mapId != this.mapId || this.mapLevel != mapLevel {
-		util.InfoF("uid=%v bossRewardCheck mapId=%v level=%v invalid", this.role.GetUUid(), mapId, mapLevel)
-		return serverproto.ErrorCode_ERROR_BATTLE_LEVEL_INVALID
+	ishard := this.role.isHardFight
+	if ishard {
+		//发送的关卡ID不合法(重发协议)
+		if mapId != this.mapIdHard || this.mapLevelHard != mapLevel {
+			util.InfoF("uid=%v bossRewardCheck mapId=%v level=%v invalid", this.role.GetUUid(), mapId, mapLevel)
+			return serverproto.ErrorCode_ERROR_BATTLE_LEVEL_INVALID
+		}
+	} else {
+		//发送的关卡ID不合法(重发协议)
+		if mapId != this.mapId || this.mapLevel != mapLevel {
+			util.InfoF("uid=%v bossRewardCheck mapId=%v level=%v invalid", this.role.GetUUid(), mapId, mapLevel)
+			return serverproto.ErrorCode_ERROR_BATTLE_LEVEL_INVALID
+		}
 	}
 
 	deltaTime := (util.GetTimeMilliseconds() - this.mapLevelTime) / 1000
 	//时间判断 CloseDown
 	levelId := this.getLevelId(this.mapId, this.mapLevel)
+	if ishard {
+		levelId = this.getLevelId(this.mapIdHard, this.mapLevelHard)
+	}
 	levelCfgData, ok := serverproto.LevelCfgLoader[levelId]
 	if !ok {
 		return serverproto.ErrorCode_ERROR_BATTLE_LEVEL_DATA_NOT_FOUND
 	}
-	tmpStrList := strings.Split(levelCfgData.CloseDown, ";")
-	if len(tmpStrList) >= 2 {
-		//tmpChallengeTime, _ := model.Str2Num(tmpStrList[0])
-		tmpChallengeTime := 10 //挑战时间小于10s
-		//tmpRecharge, _ := model.Str2Num(tmpStrList[1])
-		tmpRecharge := 10000 //充值小于1W
-		//1 在对应关卡或者爬塔层的停留时间≥60分钟时,不会触发判定外挂机制
-		//2 玩家战力≥2.5*最低通关战力时,不会触发判定机制
-		fightCheck := uint64(levelCfgData.FightCheck) * 25 / 10
-		if deltaTime < 60*60 && this.role.roleBattleAttr.curTotalFightPower < uint32(fightCheck) {
-			if int(this.role.GetTotalRecharge()) < tmpRecharge && challengeTime < uint32(tmpChallengeTime) {
-				this.role.GetRoleStatistic().RecordCheatData(CheatType_NormalLevel)
-				return serverproto.ErrorCode_ERROR_BATTLE_LEVEL_CD_TIME
-			}
+	//tmpStrList := strings.Split(levelCfgData.CloseDown, ";")
+
+	//tmpChallengeTime, _ := model.Str2Num(tmpStrList[0])
+	tmpChallengeTime := 10 //挑战时间小于10s
+	//tmpRecharge, _ := model.Str2Num(tmpStrList[1])
+	tmpRecharge := 30000 //充值小于1W
+	//1 在对应关卡或者爬塔层的停留时间≥60分钟时,不会触发判定外挂机制
+	//2 玩家战力≥2.5*最低通关战力时,不会触发判定机制
+	fightCheck := uint64(levelCfgData.FightCheck) * 25 / 10
+	if deltaTime < 60*60 && this.role.roleBattleAttr.curTotalFightPower < uint32(fightCheck) {
+		if int(this.role.GetTotalRecharge()) < tmpRecharge && challengeTime < uint32(tmpChallengeTime) {
+			util.ErrorF("uid:%v bosscheck failed totalrecharge:%v challengeTime:%v", this.role.GetUUid(), this.role.GetTotalRecharge(), challengeTime)
+			this.role.GetRoleStatistic().RecordCheatData(CheatType_NormalLevel)
+			return serverproto.ErrorCode_ERROR_BATTLE_LEVEL_CD_TIME
 		}
 	}