playsocketjs 1.4.0 → 1.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.
|
@@ -2380,7 +2380,7 @@ function requireServer () {
|
|
|
2380
2380
|
const roomCrdtManager = new CRDTManager(this.#debug); // Create the room's crdt manager
|
|
2381
2381
|
|
|
2382
2382
|
// Event callback with potential initial storage modifications
|
|
2383
|
-
const reviewedStorage = await this.#triggerEvent("roomCreationRequested", { roomId: newRoomId, clientId: ws.clientId, initialStorage: structuredClone(data.initialStorage
|
|
2383
|
+
const reviewedStorage = await this.#triggerEvent("roomCreationRequested", { roomId: newRoomId, clientId: ws.clientId, initialStorage: structuredClone({ ...data.initialStorage }) });
|
|
2384
2384
|
if (typeof reviewedStorage === 'object') data.initialStorage = reviewedStorage;
|
|
2385
2385
|
|
|
2386
2386
|
// Check if client/creator is still connected
|
|
@@ -2404,7 +2404,7 @@ function requireServer () {
|
|
|
2404
2404
|
maxSize: data.size || null,
|
|
2405
2405
|
crdtManager: roomCrdtManager
|
|
2406
2406
|
};
|
|
2407
|
-
this.#clientRooms.set(ws.clientId, newRoomId); // Add client to
|
|
2407
|
+
this.#clientRooms.set(ws.clientId, newRoomId); // Add client to the room
|
|
2408
2408
|
|
|
2409
2409
|
ws.send(encode({ type: 'room_created', state: roomCrdtManager.getState }), { binary: true });
|
|
2410
2410
|
this.#triggerEvent("roomCreated", newRoomId);
|