Skip to main content

Protocol

Data#

Every message uses flatbuffers and flexbuffers to add variant data such as method arguments and return values. The Stardust XR Message schema is:

namespace StardustXR;
table Message {    type: ubyte;    id: uint;    object: string;    method: string;    error: string;    data:[ubyte] (flexbuffer);}
root_type Message;

Message Types#

All fields not accounted for are assumed to be not included or 0 or ""

Error#

Field NameValue
type0
id0 or ID of method call
objectPath to the object the error comes from
methodWhat method caused the error (if applicable, otherwise this is an empty string)
errorString containing the error message itself
dataEmpty vector

Signal#

Signals are method calls that do not expect a response of any kind.

Field NameValue
type1
objectPath to object to send signal to
methodName of the method to execute
dataFlexbuffer containing arguments to pass to remote method

Method Call#

Method calls allow for remote procedure calling.

Field NameValue
type2
idDynamically generated ID to identify method return for this method
objectPath to object to execute method on
methodName of the method to execute
dataFlexbuffer containing arguments to pass to remote method

Method Return#

Message to pass the return value back to the program.

Field NameValue
type3
idThe same as the message call's ID
dataFlexbuffer containing return value

Data Types#

Stardust does not support the Map or FixedTypedVector flexbuffers datatypes.

Color#

A Vector of 4 float is treated as a Color in the form RGBA.

Vector2#

A Vector of 2 double is treated as a Vector2.

Vector3#

A Vector of 3 double is treated as a Vector3.

Quaternion#

A Vector of 4 double is treated as a Quaternion.