巅峰演武:赛季优化修改

This commit is contained in:
luying
2022-10-17 14:42:40 +08:00
parent ddff18eb20
commit 08ca06d7ac
30 changed files with 590 additions and 272 deletions

View File

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