feat(共鸣系统): 添加获取数据频率限制、修改上阵装备养成限制条件

This commit is contained in:
zhangxk
2023-10-10 14:43:15 +08:00
parent e82e6b63ba
commit 30a23d3632
3 changed files with 19 additions and 3 deletions

View File

@@ -84,7 +84,21 @@ export class HeroHandler {
if (jobStage) return resResult(STATUS.RESONANCE_PUT_POSITION_EXIST_JOBSTAGE); if (jobStage) return resResult(STATUS.RESONANCE_PUT_POSITION_EXIST_JOBSTAGE);
if (skins.find(cur => (cur?.usedTalentPoint || 0) > 0)) return resResult(STATUS.RESONANCE_PUT_POSITION_EXIST_TALENT); if (skins.find(cur => (cur?.usedTalentPoint || 0) > 0)) return resResult(STATUS.RESONANCE_PUT_POSITION_EXIST_TALENT);
if (connections.length > 0) return resResult(STATUS.RESONANCE_PUT_POSITION_EXIST_CONNECT); if (connections.length > 0) return resResult(STATUS.RESONANCE_PUT_POSITION_EXIST_CONNECT);
if (ePlace.length > 0) return resResult(STATUS.RESONANCE_PUT_POSITION_EXIST_EQUIP); //TODO // if (ePlace.length > 0) return resResult(STATUS.RESONANCE_PUT_POSITION_EXIST_EQUIP);
if (ePlace.length > 0) {
for (let obj of ePlace) {
let newEplace = await getInitEplace(obj.id, skinId);
if (obj.lv != newEplace.lv || obj.quality != newEplace.quality || obj.qualityStage != newEplace.qualityStage ||
obj.star != newEplace.star || obj.starStage != newEplace.starStage || obj.jewel != newEplace.jewel) {
return resResult(STATUS.RESONANCE_PUT_POSITION_EXIST_EQUIP);
}
for (let st of obj.stones) {
if (st.stone != (newEplace.stones.find(cur => cur.id == st.id)?.stone || 0)) {
return resResult(STATUS.RESONANCE_PUT_POSITION_EXIST_EQUIP);
}
}
}
}
let result = await ResonanceModel.updateByPosition(roleId, position, { hid, seqId, lv, exp, jobStage, skinId, skins, connections, ePlace, ce }); let result = await ResonanceModel.updateByPosition(roleId, position, { hid, seqId, lv, exp, jobStage, skinId, skins, connections, ePlace, ce });
if (!result) return resResult(STATUS.RESONANCE_PUT_POSITION_FAIL); if (!result) return resResult(STATUS.RESONANCE_PUT_POSITION_FAIL);

View File

@@ -255,7 +255,7 @@ export function sortData(dbResonanceMap: Map<number, ResonanceType>, heroes: Her
} }
} }
return topLineHeroes[1 - 1]; return topLineHeroes[LINEUP_NUM - 1];
} }
export function sortByConnect(heroes: HeroType[], index: number) { export function sortByConnect(heroes: HeroType[], index: number) {

View File

@@ -56,7 +56,9 @@
{ "id": 42, "desc": "许愿池捐献", "route": "guild.wishPoolHandler.donateGoods", "param": {}, "interval": 1000 }, { "id": 42, "desc": "许愿池捐献", "route": "guild.wishPoolHandler.donateGoods", "param": {}, "interval": 1000 },
{ "id": 43, "desc": "宝石一键合成", "route": "role.equipHandler.composeStoneByItId", "param": {}, "interval": 1000 }, { "id": 43, "desc": "宝石一键合成", "route": "role.equipHandler.composeStoneByItId", "param": {}, "interval": 1000 },
{ "id": 44, "desc": "领取任务", "route": "role.taskHandler.receiveTask", "param": {}, "interval": 1000 }, { "id": 44, "desc": "领取任务", "route": "role.taskHandler.receiveTask", "param": {}, "interval": 1000 },
{ "id": 45, "desc": "学宫刷新角色卡", "route": "battle.rougeHandler.refreshInitCharaCard", "param": {}, "interval": 1000 } { "id": 45, "desc": "学宫刷新角色卡", "route": "battle.rougeHandler.refreshInitCharaCard", "param": {}, "interval": 1000 },
{ "id": 46, "desc": "共鸣获取数据", "route": "role.resonanceHandler.getData", "param": {}, "interval": 1000 }
], ],
"TIME_STAMP_OVER": 900000, "TIME_STAMP_OVER": 900000,