2.4.6.1. Commands from Server to Client

The Server sends commands to the Client over the reliable WebRTC data channel (id 100, label reliable). All commands are little-endian, packed (no padding) C structs whose first byte is a CommandPayloadType (a uint8_t; reference enum: teleport::core::CommandPayloadType) discriminator. The complete set of values is in the table below. Coordinates and units are converted on the server to the client’s AxesStandard before sending.

Any command described on this page MAY instead be delivered as a binary frame on the signaling WebSocket — the payload bytes are identical, and the server uses this fallback transport whenever the WebRTC reliable data channel is not yet open (notably for SetupCommand). Receivers MUST accept commands on either transport for the lifetime of the session; see Reliable-channel transport fallback (binary WebSocket frames).

The complete set of command types is enumerated below. Variable-length commands declare the count of the trailing array(s) inside the struct; the receiver reads sizeof(StructType) bytes followed by the trailing data.

Table 2.10 CommandPayloadType

Id

Name

Reference struct

Trailing data

0

Invalid

(never sent)

1

Shutdown

teleport::core::ShutdownCommand

none

2

Setup

teleport::core::SetupCommand

none (154 bytes; see Data Service)

3

AcknowledgeHandshake

teleport::core::AcknowledgeHandshakeCommand

visibleNodeCount × uid

4

ReconfigureVideo

teleport::core::ReconfigureVideoCommand

none (carries a fresh avs::VideoConfig)

5

NodeVisibility

teleport::core::NodeVisibilityCommand

nodesShowCount + nodesHideCount uids

6

UpdateNodeMovement

teleport::core::UpdateNodeMovementCommand

updatesCount × teleport::core::MovementUpdate

7

UpdateNodeEnabledState

teleport::core::UpdateNodeEnabledStateCommand

updatesCount × teleport::core::NodeUpdateEnabledState

8

SetNodeHighlighted

teleport::core::SetNodeHighlightedCommand

none

9

ApplyNodeAnimation

teleport::core::ApplyAnimationCommand

none (embeds teleport::core::ApplyAnimation)

10

UpdateNodeAnimationControlX

(reserved)

reserved

11

SetNodeAnimationSpeed

teleport::core::SetNodeAnimationSpeedCommand

none

12

SetupLighting

teleport::core::SetLightingCommand

num_gi_textures × uid (acked; see ack_id)

13

UpdateNodeStructure

teleport::core::UpdateNodeStructureCommand

none

14

AssignNodePosePath

teleport::core::AssignNodePosePathCommand

pathLength UTF-8 bytes

15

SetupInputs

teleport::core::SetupInputsCommand

numInputs × teleport::core::InputDefinitionNetPacket (each followed by pathLength UTF-8 bytes)

16

PingForLatency

teleport::core::PingForLatencyCommand

none (sent over the unreliable channel; client replies with PongForLatency)

17

AudioSourceMapping

teleport::core::AudioSourceMappingCommand

addedCount AddedEntry + removedCount RemovedEntry (see AudioSourceMapping command)

18

AudioParticipantStateChange

teleport::core::AudioParticipantStateChangeCommand

updateCount × Update (see AudioParticipantStateChange command)

128

SetOriginNode

teleport::core::SetOriginNodeCommand

none (acked; see ack_id)

2.4.6.1.1. Acknowledged commands

Commands derived from AckedCommand (reference: teleport::core::AckedCommand; currently SetupLighting and SetOriginNode) carry an additional uint64_t ack_id field after the 1-byte type. The client must reply with an AcknowledgementMessage containing the same ack_id. ack_id increases monotonically per session; clients can ignore any id less than or equal to one already received.

2.4.6.1.2. Selected command layouts

Table 2.11 ShutdownCommand (id = 1)

Bytes

Type

Description

1

CommandPayloadType

Shutdown

Table 2.12 ReconfigureVideoCommand (id = 4)

Bytes

Type

Description

1

CommandPayloadType

ReconfigureVideo

89

avs::VideoConfig

New video configuration (same layout as inside teleport::core::SetupCommand).

Table 2.13 NodeVisibilityCommand (id = 5)

Bytes

Type

Description

1

CommandPayloadType

NodeVisibility

8

size_t

nodesShowCount = S

8

size_t

nodesHideCount = H

8 * S

uid[]

Nodes to show.

8 * H

uid[]

Nodes to hide.

Table 2.14 UpdateNodeMovementCommand (id = 6)

Bytes

Type

Description

1

CommandPayloadType

UpdateNodeMovement

8

size_t

updatesCount = N

N * sizeof(MovementUpdate)

MovementUpdate[]

Per-node motion updates.

Table 2.15 SetNodeHighlightedCommand (id = 8)

Bytes

Type

Description

1

CommandPayloadType

SetNodeHighlighted

8

uid

nodeID

1

bool

isHighlighted

Table 2.16 ApplyAnimationCommand (id = 9)

Bytes

Type

Description

1

CommandPayloadType

ApplyNodeAnimation

4

int32

animLayer

8

int64

timestampUs – when the state should apply, in server-session time (microseconds since SetupCommand.startTimestamp_utc_unix_us).

8

uid

nodeID

8

uid

cacheID

8

uid

animationID

4

float

animTimeAtTimestamp – where in the animation we should be at timestampUs.

4

float

speedUnitsPerSecond

1

bool

loop

Table 2.17 SetNodeAnimationSpeedCommand (id = 11)

Bytes

Type

Description

1

CommandPayloadType

SetNodeAnimationSpeed

8

uid

nodeID

8

uid

animationID

4

float

speed

Table 2.18 SetLightingCommand (id = 12, acked)

Bytes

Type

Description

1

CommandPayloadType

SetupLighting

8

uint64

ack_id

57

ClientDynamicLighting

Dynamic lighting parameters (specular/diffuse/light positions, sizes, mips, mode, two cubemap uids; reference: teleport::core::ClientDynamicLighting).

Table 2.19 UpdateNodeStructureCommand (id = 13)

Bytes

Type

Description

1

CommandPayloadType

UpdateNodeStructure

8

uid

nodeID

8

uint64

confirmationNumber

8

uid

parentID

28

Pose_packed

relativePose (vec4 orientation + vec3 position).

Table 2.20 AssignNodePosePathCommand (id = 14)

Bytes

Type

Description

1

CommandPayloadType

AssignNodePosePath

8

uid

nodeID

2

uint16

pathLength = P

P

char[]

UTF-8 regular expression matching a client-side OpenXR pose path. If pathLength == 0, control of the node is returned to the server.

Table 2.21 SetupInputsCommand (id = 15)

Bytes

Type

Description

1

CommandPayloadType

SetupInputs

2

uint16

numInputs = I

I × variable

InputDefinitionNetPacket[]

Each definition is 5 bytes (InputId + InputType + pathLength) followed by pathLength UTF-8 bytes. See Input.

Table 2.22 PingForLatencyCommand (id = 16)

Bytes

Type

Description

1

CommandPayloadType

PingForLatency

8

int64

unix_time_us – the server’s UTC clock when the ping was sent, in microseconds. The client echoes it in PongForLatencyMessage.

Table 2.23 SetOriginNodeCommand (id = 128, acked)

Bytes

Type

Description

1

CommandPayloadType

SetOriginNode

8

uint64

ack_id

8

uid

origin_node – session uid of the node to use as the client’s stage-space origin.

8

uint64

valid_counter – monotonic; ignore messages with smaller values than the last received.