|
@@ -7,7 +7,6 @@ import (
|
|
|
"roserver/baseserver/model"
|
|
"roserver/baseserver/model"
|
|
|
"roserver/baseserver/set"
|
|
"roserver/baseserver/set"
|
|
|
"roserver/serverproto"
|
|
"roserver/serverproto"
|
|
|
- "strings"
|
|
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
func (this *Role) Income() {
|
|
func (this *Role) Income() {
|
|
@@ -1124,11 +1123,11 @@ func (this *RoleBattle) BossReward(challengeTime uint32, mapId, mapLevel uint32,
|
|
|
// return ret
|
|
// return ret
|
|
|
// }
|
|
// }
|
|
|
//}
|
|
//}
|
|
|
|
|
+ isHard := this.role.isHardFight
|
|
|
ret := this.bossRewardCheck(challengeTime, mapId, mapLevel)
|
|
ret := this.bossRewardCheck(challengeTime, mapId, mapLevel)
|
|
|
if ret != serverproto.ErrorCode_ERROR_OK {
|
|
if ret != serverproto.ErrorCode_ERROR_OK {
|
|
|
return ret
|
|
return ret
|
|
|
}
|
|
}
|
|
|
- isHard := this.role.isHardFight
|
|
|
|
|
levelId := this.getLevelId(this.mapId, this.mapLevel)
|
|
levelId := this.getLevelId(this.mapId, this.mapLevel)
|
|
|
if isHard {
|
|
if isHard {
|
|
|
levelId = this.getLevelId(this.mapIdHard, this.mapLevelHard)
|
|
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
|
|
return serverproto.ErrorCode_ERROR_BATTLE_LEVEL_CD_TIME
|
|
|
}
|
|
}
|
|
|
this.isChallengeBegin = false
|
|
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
|
|
deltaTime := (util.GetTimeMilliseconds() - this.mapLevelTime) / 1000
|
|
|
//时间判断 CloseDown
|
|
//时间判断 CloseDown
|
|
|
levelId := this.getLevelId(this.mapId, this.mapLevel)
|
|
levelId := this.getLevelId(this.mapId, this.mapLevel)
|
|
|
|
|
+ if ishard {
|
|
|
|
|
+ levelId = this.getLevelId(this.mapIdHard, this.mapLevelHard)
|
|
|
|
|
+ }
|
|
|
levelCfgData, ok := serverproto.LevelCfgLoader[levelId]
|
|
levelCfgData, ok := serverproto.LevelCfgLoader[levelId]
|
|
|
if !ok {
|
|
if !ok {
|
|
|
return serverproto.ErrorCode_ERROR_BATTLE_LEVEL_DATA_NOT_FOUND
|
|
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
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|