playsocketjs 2.4.0 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2628,7 +2628,7 @@ function requireServer () {
2628
2628
  #disconnectClient(ws) {
2629
2629
  this.#pendingDisconnects.delete(ws.clientId);
2630
2630
  this.#clientTokens.delete(ws.clientId);
2631
- const roomId = this.#clientRooms.get(ws.clientId);
2631
+ let roomId = this.#clientRooms.get(ws.clientId);
2632
2632
  const room = this.#rooms[roomId];
2633
2633
 
2634
2634
  if (room) {
@@ -2640,6 +2640,7 @@ function requireServer () {
2640
2640
  this.#roomVersions.delete(roomId); // Delete room version
2641
2641
  this.#triggerEvent("roomDestroyed", roomId);
2642
2642
  if (this.#debug) console.log("Deleted room with id " + roomId + ".");
2643
+ roomId = null; // If room was destroyed, set roomId to null
2643
2644
  } else {
2644
2645
  // Notify remaining participants
2645
2646
  room.participants.forEach(p => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "playsocketjs",
3
- "version": "2.4.0",
3
+ "version": "2.4.1",
4
4
  "description": "WebSocket wrapper for creating simple multiplayer systems with ease.",
5
5
  "module": "dist/playsocket-client.js",
6
6
  "exports": {