✨ feat(校验): 添加战场伤害统计伤害

This commit is contained in:
luying
2023-06-27 13:46:01 +08:00
parent d75101a730
commit 70af186564
10 changed files with 72 additions and 35 deletions
@@ -30,6 +30,7 @@ import { getAllServerName, getServerName } from '../../../services/redisService'
import { RoleRankInfo } from '../../../domain/rank';
import { isHeroHidden } from '../../../services/dataService';
import { getPVPGroupIdOfServer } from '../../../services/serverService';
import { getBattleRecordParam } from '../../../services/normalBattleService';
export default function (app: Application) {
new HandlerService(app, {});
@@ -236,7 +237,7 @@ export class PvpHandler {
}
// 结算
async pvpEnd(msg: { battleCode: string, isSuccess: boolean, myHeroes: pvpEndParamInter[], oppHeroes: pvpEndParamInter[] }, session: BackendSession) {
async pvpEnd(msg: { battleCode: string, isSuccess: boolean, myHeroes: pvpEndParamInter[], oppHeroes: pvpEndParamInter[], round: number }, session: BackendSession) {
let roleId = session.get('roleId');
let roleName = session.get('roleName');
@@ -244,7 +245,7 @@ export class PvpHandler {
const serverId = session.get('serverId');
const { battleCode, isSuccess, myHeroes, oppHeroes } = msg;
const { battleCode, isSuccess, myHeroes, oppHeroes, round } = msg;
const BattleRecord = await BattleRecordModel.getBattleRecordByCode(battleCode, true);
if (!BattleRecord || BattleRecord.status != 0) {
@@ -282,7 +283,7 @@ export class PvpHandler {
// 更新battleRecord
await BattleRecordModel.updateBattleRecordByCode(battleCode, {
$set: { status: isSuccess ? 1 : 2 }
$set: { status: isSuccess ? 1 : 2, ...getBattleRecordParam(myHeroes, round) }
}, true);
if(seasonNum == pvpSeasonNum) {