Constructor
new Client(config)
Creates a client. You need to construct a configuration before using this method.
Parameters:
Name | Type | Description |
---|---|---|
config |
Stormancer.Configuration | The configuration object for constructing the Client. |
Members
applicationName :string
The name of the Stormancer server application the client is connected to.
Type:
- string
id :string
The client's unique stormancer ID. Returns null if the ID has not been acquired yet (connection still in progress).
Type:
- string
logger :object
An user specified logger.
Type:
- object
serverPing :number
The server connection's ping in milliseconds.
Type:
- number
Methods
clock() → {number}
Get the server clock. Represented by the count of milliseconds since the cluster started.
Returns:
The number of milliseconds since the application started.
- Type
- number
disconnect()
Disconnects the client.
getPublicScene(sceneId, userData) → {Promise}
Retrieve a public scene object from its ID.
Parameters:
Name | Type | Description |
---|---|---|
sceneId |
string | The scene ID |
userData |
object | User data to send |
Returns:
Promise which complete when the scene is ready to connect.
- Type
- Promise
getScene(token) → {Promise}
Retrieve a scene object from its ID.
Parameters:
Name | Type | Description |
---|---|---|
token |
string | Scene token |
Returns:
Promise which complete when the scene is ready to connect.
- Type
- Promise