排行榜: 获取排行榜

This commit is contained in:
luying
2021-04-12 09:47:15 +08:00
parent 34e02dea89
commit 5dca7b304d
32 changed files with 1077 additions and 290 deletions
+5 -3
View File
@@ -24,7 +24,7 @@ import { DicJob } from './dictionary/DicJob';
export async function calPlayerCeAndSave(type: number, roleId: string, originHero: HeroType, update: HeroUpdate, args?: Array<number>) {
let role = await RoleModel.findByRoleId(roleId);
let { attr: roleAttrs = [] } = role;
let { attr: roleAttrs = [], serverId } = role;
let heroAttrs = calPlayerCe(originHero, update, type, args); // 根据操作计算attr的增加
@@ -52,7 +52,7 @@ export async function calPlayerCeAndSave(type: number, roleId: string, originHer
ce: reduceCe(heroCe),
incHeroCe: reduceCe(incCe),
});
return { pushHeros, role, topLineupCe, hero, guild }
return { pushHeros, role, topLineupCe, hero, guild, serverId }
}
//全局属性加成
@@ -89,8 +89,10 @@ export async function reCalAllHeroCe(type: number, roleId: string, update: RoleU
update.topLineupCe = topLineupCe;
role = await RoleModel.updateRoleInfo(roleId, update);
let guild = await GuildModel.updateCe(roleId, allIncCe); // 公会更新战力
return { role, pushHeros, ce: role.ce, topLineupCe: role.topLineupCe, guild }
return { role, pushHeros, ce: role.ce, topLineupCe: role.topLineupCe, guild, serverId: role.serverId }
}
// 计算武将全局战力