🐞 fix(后台): pvp当没有赛季的时候战区配置
This commit is contained in:
@@ -6,7 +6,7 @@ import { ACTIVITY_TYPE, GM_MAIL_STATUS, GM_MAIL_TYPE, MAIL_TIME_TYPE, MEMORY_LOG
|
|||||||
import { ActivityModel } from '../../../db/Activity';
|
import { ActivityModel } from '../../../db/Activity';
|
||||||
import { ActivityGroupModel } from '../../../db/ActivityGroup';
|
import { ActivityGroupModel } from '../../../db/ActivityGroup';
|
||||||
import { ActivityGroupTypeModel } from '../../../db/ActivityGroupType';
|
import { ActivityGroupTypeModel } from '../../../db/ActivityGroupType';
|
||||||
import { getTimeFunM, nowSeconds } from '../../../pubUtils/timeUtil';
|
import { getPastTime, getTimeFunM, nowSeconds } from '../../../pubUtils/timeUtil';
|
||||||
import moment = require('moment');
|
import moment = require('moment');
|
||||||
import { sendUngotDividend } from '../../../services/auctionService';
|
import { sendUngotDividend } from '../../../services/auctionService';
|
||||||
import { taflush } from '../../../services/sdkService';
|
import { taflush } from '../../../services/sdkService';
|
||||||
@@ -300,9 +300,9 @@ export class GmHandler {
|
|||||||
if(!isNumber(serverId)) return resResult(STATUS.WRONG_PARMS);
|
if(!isNumber(serverId)) return resResult(STATUS.WRONG_PARMS);
|
||||||
}
|
}
|
||||||
let { scheduleTime } = await getGVGConfigFromRemote();
|
let { scheduleTime } = await getGVGConfigFromRemote();
|
||||||
let { seasonEndTime = 0 } = await getPvpTimeFromRemote();
|
let { seasonNum, seasonEndTime } = await getPvpTimeFromRemote();
|
||||||
for(let serverId of serverIds) {
|
for(let serverId of serverIds) {
|
||||||
await ServerGroupModel.updateByServerId(serverId, groupId, scheduleTime, seasonEndTime);
|
await ServerGroupModel.updateByServerId(serverId, groupId, scheduleTime, seasonNum == 0? getPastTime(): seasonEndTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -740,10 +740,11 @@ export function getPvpSeasonStatus() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface PvpTime {
|
interface PvpTime {
|
||||||
seasonEndTime: number, seasonStartTime: number, seasonRewardTime: number
|
seasonNum: number, seasonEndTime: number, seasonStartTime: number, seasonRewardTime: number
|
||||||
}
|
}
|
||||||
export function getPvpTime(): PvpTime {
|
export function getPvpTime(): PvpTime {
|
||||||
return {
|
return {
|
||||||
|
seasonNum: pinus.app.get('pvpSeasonNum'),
|
||||||
seasonEndTime: pinus.app.get('pvpSeasonEndTime'),
|
seasonEndTime: pinus.app.get('pvpSeasonEndTime'),
|
||||||
seasonStartTime: pinus.app.get('pvpSeasonStartTime'),
|
seasonStartTime: pinus.app.get('pvpSeasonStartTime'),
|
||||||
seasonRewardTime: pinus.app.get('pvpSeasonRewardTime')
|
seasonRewardTime: pinus.app.get('pvpSeasonRewardTime')
|
||||||
|
|||||||
@@ -356,7 +356,7 @@ export default class Game extends Service {
|
|||||||
const currentGVGTypes = await ServerGroupModel.findByTime(nowSeconds(), 1);
|
const currentGVGTypes = await ServerGroupModel.findByTime(nowSeconds(), 1);
|
||||||
const nextGVGTypes = await ServerGroupModel.findByTime(nowSeconds() + 7 * 86400, 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 currentPVPTypes = await ServerGroupModel.findByTime(nowSeconds(), 2);
|
||||||
const nextPVPTypes = await ServerGroupModel.findByTime(seasonEndTime, 2);
|
const nextPVPTypes = await ServerGroupModel.findByTime(seasonEndTime, 2);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user