mirror of
https://github.com/Rolands-Laucis/Socio.git
synced 2026-05-15 14:15:57 -06:00
upd SendToClients types
This commit is contained in:
parent
8565b0ada8
commit
f9fe6df84f
2 changed files with 3 additions and 2 deletions
|
|
@ -917,7 +917,7 @@ export class SocioServer extends LogHandler {
|
|||
}
|
||||
|
||||
//send some data to all clients by their ID or unique name, if they have one. By default emits to all connected clients
|
||||
async SendToClients(clients: string[] = [], data: object = {}, kind: ClientMessageKind = ClientMessageKind.CMD){
|
||||
async SendToClients(clients: (ClientID | string)[] = [], data: object = {}, kind: ClientMessageKind = ClientMessageKind.CMD){
|
||||
let sessions = this.#sessions.values(); //all clients by default
|
||||
if(clients.length) //filter specified ones
|
||||
sessions = sessions.filter(c => clients.includes(c.id) || (c?.name && clients.includes(c.name)));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue