任务:埋点48/71

This commit is contained in:
luying
2021-04-19 13:17:17 +08:00
parent 9f4f346447
commit 4bd4513ae6
11 changed files with 186 additions and 37 deletions
@@ -56,17 +56,19 @@ export async function roleLevelup(roleId: string, kingExp: number, session: Back
}
export async function checkBattleHeroes(roleId: string, heroes: Array<number>) {
export async function checkBattleHeroes(roleId: string, seqIds: Array<number>) {
let heroes: number[] = [];
let flag = true;
if(heroes.length <= 0) flag = false;
if(seqIds.length <= 0) flag = false;
const findHeroes = await HeroModel.findBySeqIdRange(heroes, roleId);
if(findHeroes.length != heroes.length) flag = false;
for(let seqId of heroes) {
const findHeroes = await HeroModel.findBySeqIdRange(seqIds, roleId);
if(findHeroes.length != seqIds.length) flag = false;
for(let seqId of seqIds) {
let hero = findHeroes.find(cur => cur.seqId == seqId);
if(!hero) flag = false;
heroes.push(hero.hid);
}
return flag;
return { isOK: flag, heroes };
}
export async function checkBattleHeroesByHid(roleId: string, heroes: Array<number>) {