From dcb5704fd1d8d58ca5c79f2174b6df4873470971 Mon Sep 17 00:00:00 2001 From: luying Date: Tue, 25 Apr 2023 16:57:53 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix(=E6=9C=8D=E5=8A=A1=E5=99=A8)?= =?UTF-8?q?:=20=E8=87=AA=E5=8A=A8=E5=BC=80=E6=9C=8D=E6=97=B6=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=88=98=E5=8C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app/services/serverService.ts | 5 +++++ shared/db/ServerStategy.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/game-server/app/services/serverService.ts b/game-server/app/services/serverService.ts index 139921f2b..cf1d7566e 100644 --- a/game-server/app/services/serverService.ts +++ b/game-server/app/services/serverService.ts @@ -167,5 +167,10 @@ export async function createNewServer(region: RegionType ,serverId: number, para await RegionModel.newServer(region.id, newServer); await redisClient().hsetAsync(REDIS_KEY.SERVER, `${newServer.id}`, `${newServer.name}`); await redisClient().hsetAsync(REDIS_KEY.SERVER_OPEN_TIME, `${newServer.id}`, `${newServer.openTime}`); + await pinus.app.rpc.guild.guildRemote.setServerGroup.broadcast(); + await pinus.app.rpc.chat.chatRemote.setServerGroup.broadcast(); + await pinus.app.rpc.connector.connectorRemote.setServerGroup.broadcast(); + await pinus.app.rpc.gm.gmRemote.setServerGroup.broadcast(); + await pinus.app.rpc.systimer.systimerRemote.setServerGroup.broadcast(); } \ No newline at end of file diff --git a/shared/db/ServerStategy.ts b/shared/db/ServerStategy.ts index e5c2b604c..c12396f86 100644 --- a/shared/db/ServerStategy.ts +++ b/shared/db/ServerStategy.ts @@ -62,7 +62,7 @@ export default class ServerStategy { @prop({ required: true, default: 0 }) type: number; // 类型 1-定时 2-人数到了既时 - @prop({ required: true, default: 0, type: String }) + @prop({ required: true, type: String }) timers: string[]; // 开服时间点 @prop({ required: true, type: Number }) @@ -78,7 +78,7 @@ export default class ServerStategy { this.isOpen = stategy.isOpen; this.maxPlayerCnt = stategy.maxPlayerCnt; this.type = stategy.type; - this.timers = stategy.timers; + if(stategy.timers) this.timers = stategy.timers; this.activityGroupId = stategy.activityGroupId; this.stopRegisterTime = stategy.stopRegisterTime; if(stategy.hasOpenMail) {