✨ feat(战场): 保存战阵连携顺序
This commit is contained in:
@@ -748,13 +748,14 @@ export function checkRouteParam(route: string, msg: any) {
|
||||
}
|
||||
case "battle.pvpHandler.saveDefense":
|
||||
{
|
||||
let { heroes, warId, buff } = msg;
|
||||
let { heroes, warId, buff, combo } = msg;
|
||||
if (!checkNaturalArray(heroes)) return false;
|
||||
if (!checkNaturalNumbers(warId, buff)) return false;
|
||||
if (heroes.length > LINEUP_NUM) return false;
|
||||
for (let { actorId, dataId, order, ai } of heroes) {
|
||||
if (!checkNaturalNumbers(actorId, dataId, order, ai)) return false;
|
||||
}
|
||||
if(!checkCombo(combo)) return false
|
||||
break;
|
||||
}
|
||||
case "battle.pvpHandler.receiveBox":
|
||||
@@ -815,6 +816,7 @@ export function checkRouteParam(route: string, msg: any) {
|
||||
for (let { actorId, dataId, order } of msg.heroes) {
|
||||
if (!checkNaturalNumbers(actorId, dataId, order)) return false;
|
||||
}
|
||||
if(!checkCombo(msg.combo)) return false
|
||||
break;
|
||||
}
|
||||
case "battle.ladderHandler.buyCnt":
|
||||
@@ -2302,4 +2304,18 @@ function checkSeqId(...seqIds: (number | string)[]) {
|
||||
if (!checkNaturalNumbers(<number>seqId) && !checkNaturalStrings(<string>seqId)) return false
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function checkCombo(combo: {groupId: number, levelList: number[]}[]) {
|
||||
if(combo) {
|
||||
if(!isArray(combo)) return false;
|
||||
for(let {groupId, levelList} of combo) {
|
||||
if(!isNumber(groupId)) return false;
|
||||
if(!isArray(levelList)) return false;
|
||||
for(let lv of levelList) {
|
||||
if(!isNumber(lv)) return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user