参数校验
This commit is contained in:
@@ -753,7 +753,7 @@ export function checkRouteParam(route: string, msg: any) {
|
||||
}
|
||||
case "battle.towerBattleHandler.settleTask":
|
||||
{
|
||||
if(!checkNaturalNumbers(msg.batchCode, msg.taskCode)) return false;
|
||||
if(!checkStringIfExist(msg.batchCode, msg.taskCode)) return false;
|
||||
break;
|
||||
}
|
||||
case "battle.towerBattleHandler.receiveBox":
|
||||
|
||||
@@ -168,7 +168,9 @@ function randomRank(isBefore: boolean, myRank: number, range: number, len: numbe
|
||||
let rand = getRandValueByMinMax(n * i + 1, n * (i + 1) + 1, 0); // 因为这个的范围是[min, max),而想要的是 (n * i, n * (i - 1)]
|
||||
if(rand) {
|
||||
let ratio = isBefore? -1: 1;
|
||||
arr.push(myRank + ratio * rand);
|
||||
let rank = myRank + ratio * rand;
|
||||
if( rank > 3001) rank = 3001;
|
||||
arr.push(rank);
|
||||
}
|
||||
}
|
||||
return arr;
|
||||
|
||||
Reference in New Issue
Block a user