The main client for interacting with the ER:LC API and gateway. Manages multiple ER:LC game servers, each with its own caches and polling loop.
Signature:
declare class Client extends EventEmitter<ClientEvents>Extends: EventEmitter<ClientEvents>
#Constructors
|
Constructor |
Modifiers |
Description |
|---|---|---|
|
Creates an instance of Client. |
#Properties
|
Property |
Modifiers |
Type |
Description |
|---|---|---|---|
|
string | number |
(Optional) Global App ID. | ||
|
|
boolean |
Whether any managed server is currently being polled. | |
|
REST Manager for sending manual requests to the ER:LC API, shared across all servers. | |||
|
Collection of the game servers managed by this client, keyed by server ID. |
#Methods
|
Method |
Modifiers |
Description |
|---|---|---|
|
Adds a server to the client at runtime, returning the created server. Polling is started automatically if the client options enable auto-start polling. | ||
|
Destroys the client, cleaning up resources and stopping any ongoing operations. | ||
|
Resolves once the client is ready (after every server's first poll), or immediately if it is already ready. | ||
|
Registers an in-game custom command globally, available on all managed servers. | ||
|
Removes and destroys a server by its ID, stopping its polling and clearing its caches. | ||
|
Starts polling the ER:LC API for all servers, restarting any existing polls. | ||
|
Stops polling the ER:LC API for all servers. | ||
|
Unregisters a globally registered in-game custom command. | ||
|
Waits for a specific event to be emitted. |