playsocketjs 2.4.0 → 2.4.2
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
|
-
|
|
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 => {
|
|
@@ -2736,6 +2737,7 @@ function requireServer () {
|
|
|
2736
2737
|
}), { binary: true });
|
|
2737
2738
|
}
|
|
2738
2739
|
});
|
|
2740
|
+
this.#triggerEvent("storageUpdated", { roomId, clientId: null, update: structuredClone(propertyUpdate), storage: this.getRoomStorage(roomId) });
|
|
2739
2741
|
}
|
|
2740
2742
|
}
|
|
2741
2743
|
|