🐞 fix(共鸣系统):修改数据下发
This commit is contained in:
@@ -518,9 +518,12 @@ export async function calculateCes(type: HERO_SYSTEM_TYPE, roleId: string, serve
|
||||
}
|
||||
let { heroCe, roleInc } = calCe.getCeInc(); // 计算战力,获得有变化的武将战力
|
||||
let changeHids: number[] = [];
|
||||
let pushHeros = new Array<{ hid: number, ce: number, incHeroCe: number }>();
|
||||
let pushHeros = new Array<{ hid: number, ce: number, incHeroCe: number, isResonance:boolean }>();
|
||||
let heroes: HeroType[] = [];
|
||||
|
||||
const { dbResonanceMap } = await getResonanceDataMap(roleId);
|
||||
let isResonance = false
|
||||
|
||||
for(let [hid, heroUpdate] of heroUpdates) {
|
||||
if(heroCe.has(hid)) {
|
||||
let { ce, inc } = heroCe.get(hid);
|
||||
@@ -531,7 +534,8 @@ export async function calculateCes(type: HERO_SYSTEM_TYPE, roleId: string, serve
|
||||
await PvpDefenseModel.updateCe(roleId, hid, ce); // 更新pvp防守阵战力
|
||||
await LadderMatchModel.updateCe(roleId, hid, ce);
|
||||
await GVGVestigeRankModel.updateCe(roleId, hid, ce);
|
||||
pushHeros.push({ hid, ce, incHeroCe: inc });
|
||||
if(dbResonanceMap.has(hid)) isResonance = true;
|
||||
pushHeros.push({ hid, ce, incHeroCe: inc, isResonance });
|
||||
} else {
|
||||
let hero = await HeroModel.updateHeroInfo(roleId, hid, heroUpdate);
|
||||
heroes.push(hero);
|
||||
@@ -543,11 +547,11 @@ export async function calculateCes(type: HERO_SYSTEM_TYPE, roleId: string, serve
|
||||
await PvpDefenseModel.updateCe(roleId, hid, ce); // 更新pvp防守阵战力
|
||||
await LadderMatchModel.updateCe(roleId, hid, ce);
|
||||
await GVGVestigeRankModel.updateCe(roleId, hid, ce);
|
||||
pushHeros.push({ hid, ce: hero.ce, incHeroCe: inc });
|
||||
if(dbResonanceMap.has(hid)) isResonance = true;
|
||||
pushHeros.push({ hid, ce: hero.ce, incHeroCe: inc, isResonance });
|
||||
}
|
||||
}
|
||||
|
||||
const { dbResonanceMap } = await getResonanceDataMap(roleId);
|
||||
let { topLineup, topLineupCe, hasTopCeChange } = calCe.getTopLineupNew(dbResonanceMap);
|
||||
let roleCeUpdate: RoleCeUpdate = calCe.getRoleCeTable();
|
||||
if(topLineupCe > (roleCe?.historyLineupCe||0)) {
|
||||
@@ -560,6 +564,7 @@ export async function calculateCes(type: HERO_SYSTEM_TYPE, roleId: string, serve
|
||||
|
||||
saveCeChangeLog(role, roleInc, role.ce, type, ceChangeTxt);
|
||||
updateRank(roleId, serverId, topLineupCe, role, pushHeros, guild);
|
||||
|
||||
sendMessageToUserWithSuc(roleId, PUSH_ROUTE.PLAYER_CE_UPDATE, { ce: role.ce, heros: pushHeros, topLineupCe, topLineup }, sid);
|
||||
if(hasTopCeChange) await updateRoleOnlineInfo(roleId, { topLineupCe });
|
||||
if(guild) {
|
||||
|
||||
Reference in New Issue
Block a user