🐞 fix(防加速): 添加校验参数

This commit is contained in:
luying
2023-08-16 19:12:13 +08:00
parent 7c3a98bb9d
commit 55e3310f31
3 changed files with 10 additions and 12 deletions
+4 -6
View File
@@ -558,10 +558,10 @@ export function checkRouteParam(route: string, msg: any) {
}
case "comBattle.comBattleHandler.action":
{
let { teamCode, bossHurts, killed, curRnd, timegap = 0 } = msg;
let { teamCode, bossHurts, killed, curRnd, timegap = 0, roundTime = 0 } = msg;
if (!checkNaturalStrings(teamCode)) return false;
if (!checkNumberArray(killed)) return false;
if (!checkNaturalNumbers(curRnd, timegap)) return false;
if (!checkNaturalNumbers(curRnd, timegap, roundTime)) return false;
if (!checkArrayCanEmpty(bossHurts)) return false;
for (let { hid, dataId, hurtHp } of bossHurts) {
if (hid && !checkNaturalNumbers(hid)) return false;
@@ -1082,10 +1082,8 @@ export function checkRouteParam(route: string, msg: any) {
}
case "guild.cityActivityHandler.hitGate":
{
let { cityId, code, damage, hid, round, timegap = 0 } = msg;
console.log('###### timegap 1', timegap)
if (!checkNaturalNumbers(cityId, damage, hid, round, timegap)) return false;
console.log('###### timegap 2', timegap)
let { cityId, code, damage, hid, round, timegap = 0, roundTime = 0 } = msg;
if (!checkNaturalNumbers(cityId, damage, hid, round, timegap, roundTime)) return false;
if (!checkNaturalStrings(code)) return false;
break;
}