We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3d68875 commit 94ff492Copy full SHA for 94ff492
src/lib/Structures/NodeServerClient.ts
@@ -24,6 +24,14 @@ export class NodeServerClient extends SocketHandler {
24
const sName = await this.send(kIdentify);
25
this.status = STATUS.READY;
26
this.name = sName;
27
+
28
+ // Disconnect if a previous socket existed.
29
+ const existing = this.server.clients.get(sName);
30
+ if (existing) {
31
+ existing.disconnect();
32
+ }
33
34
+ // Add this socket to the clients.
35
this.server.clients.set(sName, this);
36
this.node.emit('client.identify', this);
37
} catch {
0 commit comments