pvp:修复pvp赛季设置问题

This commit is contained in:
luying
2022-01-13 18:15:57 +08:00
parent cc27f74179
commit afacfb59a1
4 changed files with 23 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
import { Application, ChannelService, FrontendSession, RemoterClass, HandlerService, } from 'pinus'; import { Application, ChannelService, FrontendSession, RemoterClass, HandlerService, } from 'pinus';
import { PVPConfigType } from '../../../db/SystemConfig'; import { PVPConfigModel, PVPConfigType } from '../../../db/SystemConfig';
import { reloadResources } from '../../../pubUtils/data'; import { reloadResources } from '../../../pubUtils/data';
import { getServerMainten, setServerMainten, stopServerMainten } from '../../../services/gmService'; import { getServerMainten, setServerMainten, stopServerMainten } from '../../../services/gmService';
import { taflush } from '../../../services/sdkService'; import { taflush } from '../../../services/sdkService';
@@ -14,6 +14,7 @@ export class BattleRemote {
constructor(private app: Application) { constructor(private app: Application) {
this.app = app; this.app = app;
this.channelService = app.get('channelService'); this.channelService = app.get('channelService');
this.initPvpSeasonNum();
} }
private channelService: ChannelService; private channelService: ChannelService;
@@ -90,6 +91,11 @@ export class BattleRemote {
} }
} }
public async initPvpSeasonNum() {
let pvpConfig = await PVPConfigModel.findCurPVPConfig();
this.setPvpSeasonNum(pvpConfig);
}
public setServerMainten(serverIds: number[], startTime: number, endTime: number) { public setServerMainten(serverIds: number[], startTime: number, endTime: number) {
setServerMainten(serverIds, startTime, endTime); setServerMainten(serverIds, startTime, endTime);
} }

View File

@@ -4,7 +4,7 @@ import { resResult } from '../../../pubUtils/util';
import { reloadResources } from '../../../pubUtils/data'; import { reloadResources } from '../../../pubUtils/data';
import { UserGuildType } from '../../../db/UserGuild'; import { UserGuildType } from '../../../db/UserGuild';
import { kickUser } from '../../../services/connectorService'; import { kickUser } from '../../../services/connectorService';
import { PVPConfigType } from '../../../db/SystemConfig'; import { PVPConfigModel, PVPConfigType } from '../../../db/SystemConfig';
import { setDicAuctionTime } from '../../../services/guildActivityService'; import { setDicAuctionTime } from '../../../services/guildActivityService';
import { getServerMainten, setServerMainten, stopServerMainten } from '../../../services/gmService'; import { getServerMainten, setServerMainten, stopServerMainten } from '../../../services/gmService';
import { taflush } from '../../../services/sdkService'; import { taflush } from '../../../services/sdkService';
@@ -17,6 +17,7 @@ export class ConnectorRemote {
constructor(private app: Application) { constructor(private app: Application) {
this.app = app; this.app = app;
this.initPvpSeasonNum();
} }
public async remoteLogin(uid: string, message?: any) { public async remoteLogin(uid: string, message?: any) {
@@ -89,6 +90,11 @@ export class ConnectorRemote {
} }
} }
public async initPvpSeasonNum() {
let pvpConfig = await PVPConfigModel.findCurPVPConfig();
this.setPvpSeasonNum(pvpConfig);
}
/** /**
* 改变字典表中的拍卖行时间 * 改变字典表中的拍卖行时间
*/ */

View File

@@ -9,7 +9,7 @@ import { getInitRoleInfo } from '../../../pubUtils/roleUtil';
import { DEFAULT_HEROES } from '../../../consts'; import { DEFAULT_HEROES } from '../../../consts';
import { Figure } from '../../../domain/dbGeneral'; import { Figure } from '../../../domain/dbGeneral';
import { getDefaultRoleInfo } from '../../../services/roleService'; import { getDefaultRoleInfo } from '../../../services/roleService';
import { PVPConfigType } from '../../../db/SystemConfig'; import { PVPConfigModel, PVPConfigType } from '../../../db/SystemConfig';
import { treatRoleName, taflush } from '../../../services/sdkService'; import { treatRoleName, taflush } from '../../../services/sdkService';
import { getServerMainten, setServerMainten, stopServerMainten } from '../../../services/gmService'; import { getServerMainten, setServerMainten, stopServerMainten } from '../../../services/gmService';
@@ -25,6 +25,7 @@ export class RoleRemote {
this.channelService = app.get('channelService'); this.channelService = app.get('channelService');
this.setInitRole(); this.setInitRole();
this.loadRankFirst(); this.loadRankFirst();
this.initPvpSeasonNum();
} }
private channelService: ChannelService; private channelService: ChannelService;
private initHeroes: Map<number, HeroUpdate> = new Map(); // hid => hero private initHeroes: Map<number, HeroUpdate> = new Map(); // hid => hero
@@ -122,6 +123,11 @@ export class RoleRemote {
} }
} }
public async initPvpSeasonNum() {
let pvpConfig = await PVPConfigModel.findCurPVPConfig();
this.setPvpSeasonNum(pvpConfig);
}
public async treatRoleName(roleId: string) { public async treatRoleName(roleId: string) {
await treatRoleName(roleId); await treatRoleName(roleId);
} }

View File

@@ -241,8 +241,8 @@ module.exports = {
'connector': [ 'connector': [
{ 'id': 'connector-server-4', 'host': '172.26.145.171', 'port': 9061, 'clientHost': '121.89.211.172', 'clientPort': 3050, 'frontend': true, "args": " --inspect=9237" }, { 'id': 'connector-server-4', 'host': '172.26.145.171', 'port': 9061, 'clientHost': '121.89.211.172', 'clientPort': 3050, 'frontend': true, "args": " --inspect=9237" },
], ],
'activity': [ 'battle': [
{ 'id': 'activity-server-2', 'host': '172.26.145.171', 'port': 9062, "args": " --inspect=9241" }, { 'id': 'battle-server-2', 'host': '172.26.145.171', 'port': 9062 },
] ]
}, },
'sq1': { 'sq1': {