@epicgames-ps/lib-pixelstreamingsignalling-ue5.5 / StreamerRegistry / StreamerRegistry
StreamerRegistry.StreamerRegistry
Handles all the streamer connections of a signalling server and can be used to lookup connections by id etc. Fires events when streamers are added or removed. Events: 'added': (playerId: string) Player was added. 'removed': (playerId: string) Player was removed.
-
EventEmitter↳
StreamerRegistry
• new StreamerRegistry(): StreamerRegistry
EventEmitter.constructor
• defaultStreamerIdPrefix: string = "UnknownStreamer"
• streamers: IStreamer[]
▸ add(streamer): boolean
Adds a streamer to the registry. If the streamer already has an id it will be sanitized (checked against existing ids and altered if there are collisions), or if it has no id it will be assigned a default unique id.
| Name | Type |
|---|---|
streamer |
IStreamer |
boolean
True if the add was successful.
▸ count(): number
Returns the total number of connected streamers.
number
▸ empty(): boolean
Returns true when the registry is empty.
boolean
▸ find(streamerId): undefined | IStreamer
Attempts to find the given streamer id in the registry.
| Name | Type |
|---|---|
streamerId |
string |
undefined | IStreamer
▸ getFirstStreamerId(): null | string
Used by players who haven't subscribed but try to send a message. This is to cover legacy connections that do not know how to subscribe. The player will be assigned the first streamer in the list.
null | string
The first streamerId in the registry or null if there are none.
▸ remove(streamer): boolean
Removes a streamer from the registry. If the streamer isn't found it does nothing.
| Name | Type |
|---|---|
streamer |
IStreamer |
boolean
True if the streamer was removed.