Class: RelayServerV1
Hierarchy
-
↳ RelayServerV1
Table of contents
Constructors
Properties
- messageBus
- scene
- subscriberID
- MESSAGE_UPDATE
- REQUEST_ROOM
- REQUEST_ROOM_FAILURE
- REQUEST_ROOM_SUCCESS
- SET_URL
Methods
Constructors
constructor
+ new RelayServerV1(messageBus
: IMessageBus, url?
: string, requestOptions?
: RequestInit, scene?
: IScene, subscriberID?
: number, successResponses?
: RelayServerRoomResponseV1[], errorResponses?
: Error[]): RelayServerV1
Parameters:
Name | Type |
---|---|
messageBus |
IMessageBus |
url? |
string |
requestOptions? |
RequestInit |
scene? |
IScene |
subscriberID? |
number |
successResponses |
RelayServerRoomResponseV1[] |
errorResponses |
Error[] |
Returns: RelayServerV1
Inherited from: System
Properties
messageBus
• Protected
messageBus: IMessageBus
Reference to the message bus, the fundamental piece of JamJar for communicating with other parts of the engine.
Inherited from: System.messageBus
scene
• Protected
Optional
scene: undefined | IScene
Any scene this system is part of, will change the lifecycle of the system to be part of the scene's lifecycle - it will be destroyed when the scene is destroyed.
subscriberID
• subscriberID: number
Inherited from: System.subscriberID
MESSAGE_UPDATE
▪ Readonly
Static
MESSAGE_UPDATE: system_update= "system_update"
Inherited from: System.MESSAGE_UPDATE
REQUEST_ROOM
▪ Readonly
Static
REQUEST_ROOM: jamjar_relay_server_request_room= "jamjar_relay_server_request_room"
REQUEST_ROOM_FAILURE
▪ Readonly
Static
REQUEST_ROOM_FAILURE: jamjar_relay_server_request_room_failure= "jamjar_relay_server_request_room_failure"
REQUEST_ROOM_SUCCESS
▪ Readonly
Static
REQUEST_ROOM_SUCCESS: jamjar_relay_server_request_room_success= "jamjar_relay_server_request_room_success"
SET_URL
▪ Readonly
Static
SET_URL: jamjar_relay_server_set_url= "jamjar_relay_server_set_url"
Methods
Destroy
▸ Destroy(): void
Destroy destroys the System and unsubscribes it from all messages. The System should be garbage collected after this, unless a direct reference to it exists somewhere. Therefore direct references to systems are discouraged; communication should all be through the message bus.
Returns: void
Inherited from: System
OnDestroy
▸ Protected
OnDestroy(): void
Custom Destroy logic should go here to facilitate garbage collection, for example removing listeners.
Returns: void
Inherited from: System
OnMessage
▸ OnMessage(message
: IMessage): void
Parameters:
Name | Type |
---|---|
message |
IMessage |
Returns: void
Overrides: System
Update
▸ Update(): void
Returns: void
Overrides: System
httpError
▸ Protected
httpError(error
: Error): void
Parameters:
Name | Type |
---|---|
error |
Error |
Returns: void