巅峰演武:赛季优化修改
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import { Application, ChannelService, FrontendSession, RemoterClass, HandlerService, } from 'pinus';
|
||||
import { PVPConfigModel, PVPConfigType } from '../../../db/SystemConfig';
|
||||
import { Application, ChannelService, HandlerService, } from 'pinus';
|
||||
import { PVPConfigModel, PVPConfigType } from '../../../db/PvpConfig';
|
||||
import { reloadResources } from '../../../pubUtils/data';
|
||||
import { setApiIsClose } from '../../../services/chatService';
|
||||
import { getServerMainten, setServerMainten, stopServerMainten } from '../../../services/gmService';
|
||||
import { savePvpSeasonMemory } from '../../../services/log/memoryLogService';
|
||||
import { taflush } from '../../../services/sdkService';
|
||||
import { setPvpSeasonNum, setPvpSettleSeasonNum } from '../../../services/timeTaskService';
|
||||
import { errlogger } from '../../../util/logger';
|
||||
|
||||
export default function (app: Application) {
|
||||
@@ -17,7 +18,6 @@ export class BattleRemote {
|
||||
constructor(private app: Application) {
|
||||
this.app = app;
|
||||
this.channelService = app.get('channelService');
|
||||
this.initPvpSeasonNum();
|
||||
}
|
||||
|
||||
private channelService: ChannelService;
|
||||
@@ -91,26 +91,23 @@ export class BattleRemote {
|
||||
}
|
||||
|
||||
|
||||
public setPvpSeasonNum(pvpConfig: PVPConfigType) {
|
||||
public async setPvpSettleSeasonNum(pvpConfig: PVPConfigType) {
|
||||
try {
|
||||
if(pvpConfig) {
|
||||
this.app.set('pvpSeasonNum', pvpConfig.seasonNum);
|
||||
this.app.set('pvpSeasonEndTime', pvpConfig.seasonEndTime);
|
||||
}
|
||||
await setPvpSettleSeasonNum(pvpConfig);
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
public async initPvpSeasonNum() {
|
||||
public async setPvpSeasonNum(pvpConfig: PVPConfigType) {
|
||||
try {
|
||||
let pvpConfig = await PVPConfigModel.findCurPVPConfig();
|
||||
this.setPvpSeasonNum(pvpConfig);
|
||||
await setPvpSeasonNum(pvpConfig);
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public setServerMainten(serverIds: number[], startTime: number, endTime: number) {
|
||||
try {
|
||||
setServerMainten(serverIds, startTime, endTime);
|
||||
|
||||
Reference in New Issue
Block a user