From 8669961942f243c7b8cc034fee7af9587f61a042 Mon Sep 17 00:00:00 2001 From: zhl Date: Wed, 9 Dec 2020 15:47:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9A=82=E6=97=B6=E7=A7=BB=E9=99=A4=E6=8E=89?= =?UTF-8?q?=E7=BA=BF=E9=87=8D=E8=BF=9E=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/rooms/GeneralRoom.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/rooms/GeneralRoom.ts b/src/rooms/GeneralRoom.ts index f8f19d4..2687ab5 100644 --- a/src/rooms/GeneralRoom.ts +++ b/src/rooms/GeneralRoom.ts @@ -88,18 +88,18 @@ export class GeneralRoom extends Room { } //TODO: 掉线逻辑 async onLeave (client: Client, consented: boolean) { - this.state.players.get(client.sessionId).state = PlayerStateConst.PLAYER_OFFLINE; - - try { - if (consented) { - throw new Error("consented leave"); - } - await this.allowReconnection(client, 60); - this.state.players.get(client.sessionId).state = PlayerStateConst.PLAYER_NORMAL; - - } catch (e) { - this.state.players.delete(client.sessionId); - } + // this.state.players.get(client.sessionId).state = PlayerStateConst.PLAYER_OFFLINE; + // + // try { + // if (consented) { + // throw new Error("consented leave"); + // } + // await this.allowReconnection(client, 60); + // this.state.players.get(client.sessionId).state = PlayerStateConst.PLAYER_NORMAL; + // + // } catch (e) { + // this.state.players.delete(client.sessionId); + // } } onDispose() {