后台:重新计算玩家战力

This commit is contained in:
luying
2022-06-27 15:18:21 +08:00
parent 4dcf421ebf
commit e0d9681635
5 changed files with 67 additions and 7 deletions
@@ -19,11 +19,13 @@ import { HeroModel } from '../../../db/Hero';
import { SkinModel } from '../../../db/Skin';
import { PvpDefenseModel } from '../../../db/PvpDefense';
import { createHeroes } from '../../../services/role/createHero';
import { calculateCeWithHero } from '../../../services/playerCeService';
import { calculateCeWithHero, calculateCeWithRole } from '../../../services/playerCeService';
import { pushChangeGuildLeader, pushGuildDismiss, pushGuildInfoUpdate } from '../../../services/guildService';
import { sendMessageToUserWithSuc } from '../../../services/pushService';
import { RScriptRecordModel } from '../../../db/RScriptRecord';
import { DicWar } from '../../../pubUtils/dictionary/DicWar';
import { SchoolModel } from '../../../db/School';
import { JewelModel } from '../../../db/Jewel';
let timer: NodeJS.Timer;
export default function (app: Application) {
@@ -283,4 +285,16 @@ export class GmRoleHandler {
return resResult(STATUS.SUCCESS);
}
async reCalCe(msg: { roleId: string }, session: BackendSession) {
const { roleId } = msg;
let role = await RoleModel.findByRoleId(roleId);
let schools = await SchoolModel.findByRoleId(roleId);
let jewels = await JewelModel.findbyRole(roleId);
let heroes = await HeroModel.findByRole(roleId);
let skins = await SkinModel.findbyRole(roleId);
await calculateCeWithRole(HERO_SYSTEM_TYPE.RE_CAL, roleId, role.serverId, null, {}, { role, schools, jewels, heroes, skins });
return resResult(STATUS.SUCCESS);
}
}