From fc653b37e653b421819ec618885c69f29c27aaa8 Mon Sep 17 00:00:00 2001 From: luying Date: Tue, 9 Nov 2021 11:39:34 +0800 Subject: [PATCH] =?UTF-8?q?pvp=EF=BC=9A=E5=AE=9A=E6=97=B6=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app/services/timeTaskService.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/game-server/app/services/timeTaskService.ts b/game-server/app/services/timeTaskService.ts index 4a7351af4..c6e8551de 100644 --- a/game-server/app/services/timeTaskService.ts +++ b/game-server/app/services/timeTaskService.ts @@ -100,7 +100,7 @@ async function setPvpSeason(isForce?: boolean, minute?: number) { let oldPvpConfig = await PVPConfigModel.findCurPVPConfig(); let pvpConfig = oldPvpConfig; console.log(`******** setPvpSeason2: during-${during}, seasonEndTime-${pvpConfig?.seasonEndTime}, now-${nowSeconds()}`) - if(!pvpConfig || pvpConfig.seasonEndTime <= nowSeconds() || isForce) { + if(!pvpConfig || pvpConfig.seasonEndTime - PER_MINUTE <= nowSeconds() || isForce) { if(pvpConfig && !pvpConfig.hasSettleReward) { await pvpSeasonEnd(pvpConfig.seasonNum); } @@ -109,7 +109,7 @@ async function setPvpSeason(isForce?: boolean, minute?: number) { let lastSeasonEndTime = pvpConfig? pvpConfig.seasonEndTime: 0; console.log(`******** setPvpSeason3: lastSeasonNum-${lastSeasonNum}, lastSeasonEndTime-${lastSeasonEndTime}`) - let newSeasonStartTime = lastSeasonEndTime + PER_MINUTE; + let newSeasonStartTime = lastSeasonEndTime; if(!during) during = getSeasonContinueDay(lastSeasonNum + 1) * PER_DAY; let rewardTime = PVP.PVP_SEASON_REWARD_TIME_BEFORE * PER_MINUTE; if(nowSeconds() - newSeasonStartTime > during) { @@ -128,7 +128,7 @@ async function setPvpSeason(isForce?: boolean, minute?: number) { } console.log(`******** setPvpSeason5: isForce-${isForce}, newSeasonStartTime-${newSeasonStartTime}`) let newSeasonNum = await CounterModel.getNewCounter(COUNTER.PVP_SEASON_NUM); - pvpConfig = await PVPConfigModel.createPVPConfig(newSeasonNum, newSeasonStartTime, newSeasonStartTime + during - rewardTime, newSeasonStartTime + during - PER_MINUTE); + pvpConfig = await PVPConfigModel.createPVPConfig(newSeasonNum, newSeasonStartTime, newSeasonStartTime + during - rewardTime, newSeasonStartTime + during); } await setPvpSeasonMakeRewardJob(pvpConfig); await setNextSeasonJob(pvpConfig); @@ -166,7 +166,7 @@ async function setNextSeasonJob(pvpConfig: PVPConfigType) { seasonRefreshTimeJobId.cancel(); } //定时开启新赛季,比seasonEndTime多定一分钟,保证定时器时间没错 - seasonRefreshTimeJobId = scheduleJob('seasonRefreshTimeJobId', (pvpConfig.seasonEndTime + PER_MINUTE) * 1000, setPvpSeasonJob); + seasonRefreshTimeJobId = scheduleJob('seasonRefreshTimeJobId', (pvpConfig.seasonEndTime) * 1000, setPvpSeasonJob); } /**