playsocketjs 2.0.0 → 2.1.0
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.
- package/README.md +1 -1
- package/dist/playsocket-server.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -105,7 +105,7 @@ new PlaySocket(id?: string, options: PlaySocketOptions)
|
|
|
105
105
|
- `storageUpdated`: Storage state changes (returns storage `object`)
|
|
106
106
|
- `hostMigrated`: Host changes (returns the new host's id `string`)
|
|
107
107
|
- `clientConnected`: New client connected to the room (returns client-id `string`)
|
|
108
|
-
- `clientDisconnected`: Client disconnected from the room (returns client-id `string`)
|
|
108
|
+
- `clientDisconnected`: Client disconnected from the room (returns client-id `string`, room id (if available) `string`)
|
|
109
109
|
|
|
110
110
|
### Properties (Read-only)
|
|
111
111
|
|
|
@@ -2495,7 +2495,7 @@ function requireServer () {
|
|
|
2495
2495
|
const requestorRoomId = this.#clientRooms.get(ws.clientId) || null;
|
|
2496
2496
|
this.#triggerEvent("requestReceived", { roomId: requestorRoomId, clientId: ws.clientId, name: data.request.name, data: data.request.data });
|
|
2497
2497
|
break;
|
|
2498
|
-
|
|
2498
|
+
|
|
2499
2499
|
case 'disconnect':
|
|
2500
2500
|
// Client signals to server that it will will willfully disconnect soon
|
|
2501
2501
|
ws.willfulDisconnect = true;
|
|
@@ -2627,7 +2627,7 @@ function requireServer () {
|
|
|
2627
2627
|
}
|
|
2628
2628
|
}
|
|
2629
2629
|
|
|
2630
|
-
this.#triggerEvent("clientDisconnected", ws.clientId);
|
|
2630
|
+
this.#triggerEvent("clientDisconnected", ws.clientId, roomId);
|
|
2631
2631
|
}
|
|
2632
2632
|
|
|
2633
2633
|
/**
|