Current WebRTC lock step connection with the room host (when not the host) or all room participants (when the host). This will only be initialized after calling MultiplayerController.joinOrCreateRoom.
Set to false
to disable room updates, even when still not connected to a room in
multiplayer mode.
Readonly
eventsAll events emitted by this controller.
Readonly
knownThe current MultiplayerApi. This will be undefined
if playing in single player.
Protected
multiplayerThis is populated if .startMultiplayer
is called.
Protected
Readonly
paramsProtected
rejectedRooms that have rejected the current player, so the player doesn't keep trying to connect to them.
Readonly
roomThe current connection state of the controller's connection to a multiplayer room.
Readonly
roomCurrently joined room id. If a room has not been joined yet, this will be empty.
Protected
roomUsed to keep track of the room update interval. This will be set when the controller is constructed in multiplayer mode or when a room is left. This will be cleared when a room is joined or if the controller is destroyed.
Readonly
serviceThe current connection state of the controller's connection to a backend service.
Static
Readonly
eventsAll events emitted by this controller.
Static
Readonly
knownCleanup everything.
Get all room client ids.
For host clients, this includes the host client id whereas MultiplayerController.getConnectedClientIds does not.
Get the current client's WebRTC client id. This will return undefined
if there is no
current connection.
Get all connected client ids.
For host clients, this does ont include the host client id whereas MultiplayerController.getAllClientIds does.
The current FPS of the data flow.
Detects if this controller is the room host or not.
Leave the current room or single player connection.
Start multiplayer mode. This initializes MultiplayerController.multiplayerApi and MultiplayerController.roomUpdateIntervalId.
Protected
startStarts polling the multiplayer server for room updates and fires listeners.
Start singleplayer mode.
Protected
updateSet the current connection state and fire listeners.
An all-in-one controller for singleplayer or lock-step multiplayer game state. Singleplayer mode requires no servers. Multiplayer mode requires a backend service running the MultiplayerApi.