feat(共鸣系统): 添加最强6人推送,不可养成拦截

This commit is contained in:
zhangxk
2023-10-09 20:49:24 +08:00
parent ffcdb7c0bc
commit dac8ac07a6
10 changed files with 109 additions and 42 deletions
+4 -2
View File
@@ -22,6 +22,7 @@ import { LadderMatchModel } from '../db/LadderMatch';
import { ArtifactModelType } from '../db/Artifact';
import { GVGVestigeRankModel } from '../db/GVGVestigeRank';
import { AuthorBookType } from '../db/AuthorBook';
import { getResonanceDataMap } from './role/resonanceService';
interface Param {
isInitRole?: boolean,
@@ -546,7 +547,8 @@ export async function calculateCes(type: HERO_SYSTEM_TYPE, roleId: string, serve
}
}
let { topLineup, topLineupCe, hasTopCeChange } = calCe.getTopLineup();
const { dbResonanceMap } = await getResonanceDataMap(roleId);
let { topLineup, topLineupCe, hasTopCeChange } = calCe.getTopLineupNew(dbResonanceMap);
let roleCeUpdate: RoleCeUpdate = calCe.getRoleCeTable();
if(topLineupCe > (roleCe?.historyLineupCe||0)) {
roleCeUpdate = { ...roleCeUpdate, historyLineupCe: topLineupCe };
@@ -558,7 +560,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 }, sid);
sendMessageToUserWithSuc(roleId, PUSH_ROUTE.PLAYER_CE_UPDATE, { ce: role.ce, heros: pushHeros, topLineupCe, topLineup }, sid);
if(hasTopCeChange) await updateRoleOnlineInfo(roleId, { topLineupCe });
if(guild) {
await updateUserInfo(REDIS_KEY.GUILD_INFO, guild.code, [{ field: 'guildCe', value: guild.guildCe }]);