sync-system

altspace/components. sync-system

Connect to a remote Firebase server, and facilitate synchronization. These options correspond exactly with the configuration options for altspace.utilities.sync.connect. This component must be present on a-scene for any other sync components to work.

Example
<a-scene sync-system='app: Testing; author: Altspace' altspace></a-scene>

Extends

Members

(static, readonly) isConnected :boolean

True if the sync system is connected and ready for syncing.

app :string

The name of the app.

author :string

A unique identifier for you or your organization.

instance :string

Override the instance ID. Can also be overridden with a URL parameter.

refUrl :string

Override the base reference. Set this to use your own Firebase.

Methods

instantiate(mixin, parentopt, elopt, groupNameopt, instantiatorIdopt)

Instantiate an entity with the given mixins. Instantiated entities that belong to the current user are given a "mine" class name, so that they can be selected against.

Parameters:
Name Type Attributes Description
mixin string

A comma-separated list of mixin ids which should be used to instantiate the entity.

parent Element <optional>

An element to which the entity should be added. Defaults to the scene.

el Element <optional>

The element responsible for instantiating this entity.

groupName string <optional>

A group that the entity should belong to. Used in conjunction with removeLast.

instantiatorId string <optional>

Used by removeLast to indicate who was responsible for the removed entity.

isMasterClient() → {boolean}

Returns true if the local client is the master client.

Events

clientjoined

Fired when a client joins.

Properties:
Name Type Description
id string

Guid identifying the client.

clientleft

Fired when a client leaves.

Properties:
Name Type Description
id string

Guid identifying the client.

connected

Fired when a connection is established and the sync system is fully initialized.

Properties:
Name Type Description
shouldInitialize boolean

True if this is the first client to establish a connection.