🐞 fix(gvg): 激战期挑战时间限制
This commit is contained in:
@@ -467,8 +467,9 @@ export class GVGBattleHandler {
|
||||
|
||||
let { configId, period } = getGVGPeriodData();
|
||||
if (period != GVG_PERIOD.BATTLE) return resResult(STATUS.GVG_NOT_BATTLE_PERIOD);
|
||||
let { startFightTime } = getFightTimeByPeriod(period);
|
||||
let { startFightTime, endFightTime } = getFightTimeByPeriod(period);
|
||||
if(startFightTime > nowSeconds()) return resResult(STATUS.GVG_NOT_BATTLE_TIME);
|
||||
if(endFightTime < nowSeconds()) return resResult(STATUS.GVG_BATTLE_IS_END);
|
||||
|
||||
let groupKey = await getGroupKey(serverId);
|
||||
|
||||
@@ -496,6 +497,10 @@ export class GVGBattleHandler {
|
||||
const { cityId, battleCode, isSuccess } = msg;
|
||||
|
||||
let { configId, period } = getGVGPeriodData();
|
||||
let { startFightTime, endFightTime } = getFightTimeByPeriod(period);
|
||||
if(startFightTime > nowSeconds()) return resResult(STATUS.GVG_NOT_BATTLE_TIME);
|
||||
if(endFightTime < nowSeconds()) return resResult(STATUS.GVG_BATTLE_IS_END);
|
||||
|
||||
const record = await GVGBattleRecModel.findByBattleCode(battleCode);
|
||||
if(!record) return resResult(STATUS.GVG_BATTLEREC_NOT_FOUND);
|
||||
if(record.battleEndTime > 0) return resResult(STATUS.GVG_BATTLEREC_HAS_SUMMIT);
|
||||
|
||||
Reference in New Issue
Block a user