From 8f078dd59f84810bd83f40866c9a37b93833c0cc Mon Sep 17 00:00:00 2001 From: luying Date: Mon, 20 Mar 2023 13:55:57 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix(=E5=90=8E=E5=8F=B0):=20pvp?= =?UTF-8?q?=E5=BD=93=E6=B2=A1=E6=9C=89=E8=B5=9B=E5=AD=A3=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=E6=88=98=E5=8C=BA=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app/servers/gm/handler/gmHandler.ts | 6 +++--- game-server/app/services/pvpService.ts | 3 ++- gm-server/app/service/Game.ts | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/game-server/app/servers/gm/handler/gmHandler.ts b/game-server/app/servers/gm/handler/gmHandler.ts index c0f1ace49..003cf2224 100644 --- a/game-server/app/servers/gm/handler/gmHandler.ts +++ b/game-server/app/servers/gm/handler/gmHandler.ts @@ -6,7 +6,7 @@ import { ACTIVITY_TYPE, GM_MAIL_STATUS, GM_MAIL_TYPE, MAIL_TIME_TYPE, MEMORY_LOG import { ActivityModel } from '../../../db/Activity'; import { ActivityGroupModel } from '../../../db/ActivityGroup'; import { ActivityGroupTypeModel } from '../../../db/ActivityGroupType'; -import { getTimeFunM, nowSeconds } from '../../../pubUtils/timeUtil'; +import { getPastTime, getTimeFunM, nowSeconds } from '../../../pubUtils/timeUtil'; import moment = require('moment'); import { sendUngotDividend } from '../../../services/auctionService'; import { taflush } from '../../../services/sdkService'; @@ -300,9 +300,9 @@ export class GmHandler { if(!isNumber(serverId)) return resResult(STATUS.WRONG_PARMS); } let { scheduleTime } = await getGVGConfigFromRemote(); - let { seasonEndTime = 0 } = await getPvpTimeFromRemote(); + let { seasonNum, seasonEndTime } = await getPvpTimeFromRemote(); for(let serverId of serverIds) { - await ServerGroupModel.updateByServerId(serverId, groupId, scheduleTime, seasonEndTime); + await ServerGroupModel.updateByServerId(serverId, groupId, scheduleTime, seasonNum == 0? getPastTime(): seasonEndTime); } try { diff --git a/game-server/app/services/pvpService.ts b/game-server/app/services/pvpService.ts index 92846472e..c6363cbc7 100644 --- a/game-server/app/services/pvpService.ts +++ b/game-server/app/services/pvpService.ts @@ -740,10 +740,11 @@ export function getPvpSeasonStatus() { } interface PvpTime { - seasonEndTime: number, seasonStartTime: number, seasonRewardTime: number + seasonNum: number, seasonEndTime: number, seasonStartTime: number, seasonRewardTime: number } export function getPvpTime(): PvpTime { return { + seasonNum: pinus.app.get('pvpSeasonNum'), seasonEndTime: pinus.app.get('pvpSeasonEndTime'), seasonStartTime: pinus.app.get('pvpSeasonStartTime'), seasonRewardTime: pinus.app.get('pvpSeasonRewardTime') diff --git a/gm-server/app/service/Game.ts b/gm-server/app/service/Game.ts index 0ad501341..811e6825a 100644 --- a/gm-server/app/service/Game.ts +++ b/gm-server/app/service/Game.ts @@ -356,7 +356,7 @@ export default class Game extends Service { const currentGVGTypes = await ServerGroupModel.findByTime(nowSeconds(), 1); const nextGVGTypes = await ServerGroupModel.findByTime(nowSeconds() + 7 * 86400, 1); - const { seasonEndTime } = await PVPConfigModel.findCurPVPConfig(); + const { seasonEndTime = 0 } = (await PVPConfigModel.findCurPVPConfig())||{}; const currentPVPTypes = await ServerGroupModel.findByTime(nowSeconds(), 2); const nextPVPTypes = await ServerGroupModel.findByTime(seasonEndTime, 2);