From 64d5184a5335e76131d3abec6d02dc5b2f505bd2 Mon Sep 17 00:00:00 2001 From: zhl Date: Wed, 16 Dec 2020 14:49:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E8=BE=85=E5=8A=A9=E6=9C=BA?= =?UTF-8?q?=E5=99=A8=E4=BA=BA=E6=97=B6,=20=E5=88=A4=E6=96=AD=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E5=B7=B2=E7=BB=8F=E5=AD=98=E5=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/rooms/GeneralRoom.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/rooms/GeneralRoom.ts b/src/rooms/GeneralRoom.ts index 3cd04d2..799abd0 100644 --- a/src/rooms/GeneralRoom.ts +++ b/src/rooms/GeneralRoom.ts @@ -128,6 +128,8 @@ export class GeneralRoom extends Room { } onDispose() { + this.gameClock.clear(); + this.assistMap.clear(); this.dispatcher.stop(); } @@ -268,8 +270,10 @@ export class GeneralRoom extends Room { } addAssistClient(sessionId: string) { - let client = new RobotClient(sessionId, this.state, this['onMessageHandlers']); - this.assistMap.set(sessionId, client); + if (!this.assistMap.has(sessionId)) { + let client = new RobotClient(sessionId, this.state, this['onMessageHandlers']); + this.assistMap.set(sessionId, client); + } } getAssistClient(sessionId: string): RobotClient {