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);