pvp:修复赛季结束

This commit is contained in:
luying
2021-11-08 20:34:30 +08:00
parent c571737a3c
commit 43358d0d44
4 changed files with 17 additions and 20 deletions

View File

@@ -66,11 +66,6 @@ export class PvpHandler {
}
update = { ...update, ...refOppObj }
}
if (pvpDefense.isFirstEntry) {
update.isFirstEntry = false;
result.setIsFirstEntry(true);
}
if(Object.keys(update).length > 0) {
pvpDefense = await PvpDefenseModel.updateInfoAndInclude(roleId, update);
@@ -83,8 +78,10 @@ export class PvpHandler {
result.setOppPlayers(oppPlayersReturn);
// 赛季结算
let pvpSeasonResult = await PvpSeasonResultModel.getPvpSeasonResult(roleId);
if (!!pvpSeasonResult && !!pvpSeasonResult.show) {
if (!!pvpSeasonResult && !!pvpSeasonResult.show && pvpDefense.seasonNum == seasonNum) {
result.setPvpSeasonResult(pvpSeasonResult);
result.setIsFirstEntry(true);
update.isFirstEntry = false;
await PvpSeasonResultModel.setShow(roleId);
}
// 拍卖
@@ -577,8 +574,8 @@ export class PvpHandler {
}
async debugPvpSeasonResetTime(msg: { day: number }, session: BackendSession) {
let { day: hour } = msg;
let { seasonNum, seasonEndTime } = await pinus.app.rpc.systimer.systimerRemote.resetPvpSeasonTime.toServer('systimer-server-1', hour);
let { day: minute } = msg;
let { seasonNum, seasonEndTime } = await pinus.app.rpc.systimer.systimerRemote.resetPvpSeasonTime.toServer('systimer-server-1', minute);
return resResult(STATUS.SUCCESS, { seasonNum, seasonEndTime });
}