日志:添加玩家日志

This commit is contained in:
luying
2021-12-22 21:01:06 +08:00
parent 7607ed9d0c
commit 1c28661ecf
11 changed files with 492 additions and 353 deletions
+6
View File
@@ -20,6 +20,7 @@ import { findIndex } from 'underscore';
import { GuildModel } from '../db/Guild';
import { DicJob } from './dictionary/DicJob';
import { DicSuit } from './dictionary/DicSuit';
import { saveCeChangeLog } from './logUtil';
// 修改并下发战力
export async function calPlayerCeAndSave(type: number, roleId: string, originHero: HeroType, update: HeroUpdate, args?: Array<number>) {
@@ -54,6 +55,9 @@ export async function calPlayerCeAndSave(type: number, roleId: string, originHer
ce: reduceCe(heroCe),
incHeroCe: reduceCe(incCe),
});
saveCeChangeLog(role, incCe, role.ce, type, [originHero.hid]);
return { pushHeros, role, topLineupCe, hero, guild, serverId }
}
@@ -96,6 +100,8 @@ export async function reCalAllHeroCe(type: number, roleId: string, update: RoleU
role = await RoleModel.updateRoleInfo(roleId, update);
let guild = await GuildModel.updateCe(roleId, allIncCe); // 公会更新战力
saveCeChangeLog(role, allIncCe, role.ce, type, args);
return { role, pushHeros, ce: role.ce, topLineupCe: role.topLineupCe, guild, serverId: role.serverId, heros }
}