Open Source Platform
for interconnected virtual worlds

RexProtocol

From Rex community wiki

This document lists all the extensions to the SLUDP protocol used in RealXtend. Some of these messages go quite a way back to early development and as such, are starting to become obsolete to make way for newer design. Except for two messages at the very end of this page, all of these packets use SLUDP GenericMessage as the transport mechanism.

One particularly noteworthy issue to keep in mind is that due to a historical reason, ALL of the parameters in the messages below are transmitted as ASCII strings, even if the type of the parameter was something else. This means that a float parameter 5.03f actually is transimitted as an ASCII string "5.03". Components of vectors are delimited by spaces, and boolean parameters may be transmitted as either "0"/"1" or "True"/"False", so be prepared to parse any of these. This behavior will be fixed in a future revision.

Contents

Rex Environment

These messages alter the state of the global scene environment.

RexFog

server->client

float: Start distance
float: End distance
float: Color red
float: Color green
float: Color blue

Updates the scene fog settings on the client.

RexWaterHeight

server->client

float: Height

Adjusts the water plane height on the client.

RexDrawWater

server->client

bool: draw

Disables/Enables water plane on the client.

RexAmbientL

server->client

float3: Sun direction
float4: Sun color
float3: Scene ambient color

Sets the scene-wide lighting settings on the client. When the client receives this message, the sun direction is fixed into the given position and the usual day-night cycle is stopped.

RexSky

server->client

int: Sky type
  0 - No sky box
  1 - Draw a sky box
  2 - Draw a sky dome
string: A space-separated list of sky box texture UUIDs
 [0] - Front
 [1] - Back. Only present if sky type is set to a box.
 [2] - Left. Only present if sky type is set to a box.
 [3] - Right. Only present if sky type is set to a box.
 [4] - Up. Only present if sky type is set to a box.
 [5] - Down. Only present if sky type is set to a box.  
float: Sky dome curvature. Needs to be present even if sky type is not a dome.
float: Sky dome tiling. Needs to be present even if sky type is not a dome.

Sets the sky parameters in the client.

RexToggleWindSound

server->client

bool: Disabled -flag. Either "True" or "False"

Adjusts whether the scene ambient wind sound should be played or not.

Rex Visual

These settings affect the visual presentation parameters of the viewer.

RexPostP

server->client

int: Post processing effect ID
bool: Is enabled -flag

Enables the given fullscreen post processing effect on the client. The IDs refer to a globally predefined table of post processing effects. The client should apply the post processing compositors in the order they are received.

RexRttCam

server->client

int: Command
  0 - Delete an existing RTT camera.
  1 - Create a new RTT camera.
string: A readable name for the camera to create/delete.
UUID: Identifier for the render target to create
float3: Camera position
float3: Camera lookat direction                    
float: Render target width. This should be treated as an int. 
float: Render target height. This should be treated as an int.

Creates a render-to-texture camera in the scene on the client side.

RexSetViewport

server->client

int: Command
  0 - Delete an existing viewport
  1 - Create a new viewport
string: A readable name for the viewport to create/delete.
float: Normalized [0,1] window X coordinate for the viewport.
float: Normalized [0,1] window Y coordinate for the viewport.
float: Normalized [0,1] window width for the viewport.
float: Normalized [0,1] window height for the viewport.

Creates a new viewport on the client.

RexForceFOV

server->client

float: Set the camera FOV override value, in degrees.
bool: FOV override enabled -flag.

Deprecated. If FOV override flag is false, the FOV override is cleared and the default camera FOV should be applied. If the flag is set, the given FOV value is applied.

RexForceCamera

server->client

int: Mode
  0 - Disable
  1 - First person
  3 - Third person
float: Min. zoom factor
float: Max. zoom factor

Deprecated. Forces some camera settings on the client.

Rex Scene Content

RexCSEffect

server->client

UUID: Effect ID to create
float: Time to launch delay
float: Time to live
float3: Position
quat: Orientation
float: Speed 

Spawns a client-side particle effect.

RexSCSEffect

server->client

UUID: Effect ID to create
float3: Position
quat: Orientation
bool: Enabled -flag.

If Enabled, spawns a new camera-attached particle effect. Otherwise deletes an effect with the given name.

RexPrimAnim

server->client

                   
UUID: Target object ID
string: Animation sequence name
float: Animation playback rate
bool: Looped -flag.
bool: Stop -flag.

Starts a new animation on a prim. If Looped==true, the animation loops around indefinitely. If Stop==true, the given animation is stopped instead of starting a playback.

RexAvatarProp

client->server

string: "MovementSpeed"
float: Avatar movement speed

Using this message, the client can request a desired movement speed for his avatar.

RexAppearance

server->client

string: Storage address
UUID: Target avatar UUID uuid - agentin uuid, johon appearance asetetaan
bool: Temporary appearance -flag.

Sets a new appearance for the given avatar. If Temporary appearance -flag is set, the change is not permanent and will not be remembered on next login.

RexFlashAnim

server->client

UUID: Flash animation name to start.
float: Rectangle left side coordinate, [0, 1]. 
float: Rectangle top side coordinate, [0, 1]. 
float: Rectangle right side coordinate, [0, 1]. 
float: Rectangle bottom side coordinate, [0, 1]. 
float: Time to death.

Plays back the given Flash animation in the defined viewport.

RexAnim

server->client

UUID: Target avatar UUID
UUID: Animation sequence name
float: Animation rate
float: Animation fade in time
float: Animation fade out time
int: Animation repeat count
bool: Stop -flag.

Starts an animation sequence on an avatar.

RexMorph

server->client

UUID: Target avatar UUID
string: Name of the morph animation to play
float: Morph target weight [0, 1]
float: Time to morph

RexFaceExpression

server<->client

UUID: Target avatar UUID
strings: A list of facial expression animations to play.

Deprecated. Plays back a sequence of facial expression animations.

RexData

server<->client

UUID: Target prim ID
strings: Data

Sets the Rex data block on a prim.

The list of data strings should simply be concatenated and treated as a single string. This division into multiple strings comes from SLUDP protocol limitation of being able to only have a string of 255 bytes in length.

The data is stored in key-value pairs, in the form "<32>parameter<10>value".

RexPrimData

server <-> client

UUID: Target prim ID
RexPrimData: Data

Updates the RexPrimData block related to a prim.

The contents of the Data field are treated in binary, not in ASCII. The RexPrimData structure is as follows:

struct RexPrimData
{
  u8 drawType;
  u8 isVisible;
  u8 castShadows;
  u8 lightCreatesShadows;
  u8 descriptionTexture;
  u8 scaleToPrim;
  float drawDistance;
  float LOD;
  UUID meshID;
  UUID collisionMeshID;
  UUID particleScriptID;
  UUID animationPackageID;
  string animationName;
  float animationRate;
  u8 materialIndexCount;
  materialData[materialIndexCount] = 
  {
    u8 type;
    uuid assetID;
    u8 materialIndex;
  };
  string serverScriptClass;
  uuid soundID;
  float soundVolume;
  float soundRadius;
  u32 selectPriority;
  string rexMeshUrl;
  string rexCollisionMeshUrl;
  string rexParticleScriptUrl;
  string rexAnimationPackageUrl;
  string rexSoundUrl;
  string rex_material_url[materialIndexCount];
};

RexScr

server<->client

string: Component name
string: Command
strings: Command parameters

Sends a script command to the given component, with the given parameters.

RexMediaURL

server<->client

UUID: ID of the image that this MediaURL replaces 
string: URL
int: Refresh rate

Replaces the given texture with a URL source.

RexIK

server->client

int: IK Command
  0 - Set limb parameters
  1 - Play IK
UUID: Target avatar UUID
int: IK limb ID. Only present if Command==0.
float3: IK destination.    Only present if Command==0.
float: Time-to-target.     Only present if Command==0.
float: Stay time.          Only present if Command==0.
float: Constraint angle.   Only present if Command==0.
string: Initial animation. Only present if Command==0.
string: Target animation.  Only present if Command==0.
string: Final animation.   Only present if Command==0.
string list: IK animation names to play back. Only present if Command==1. 

Deprecated. If command==0, defines an IK target. If command==1, plays back the given IK animation.

RexIK

client->server

string: "1"
UUID: Target avatar UUID
string list: IK animation names to play back.

Deprecated. Signals the server to start the playback of the given IK animation.

RexFaceExpression

server<->client

UUID: Target avatar UUID
string list: Animation names to play back. 

Deprecated. Starts the playback of the given facial expression animations.

Rex Voice

These messages are related to automatic Skype address discovery of other in-world participants.

RexSkypeAddress

server->client

string: Skype address
UUID: Target avatar UUID

Informs the client that the given avatar has skype available at the given address.

RexSkypeStore

client -> server

string: Skype address
bool: Is public -flag.

Updates the server with the information of the local client's skype address. If Is public -flag is not set, the server treats the address private.

Rex Technical Backend

These messages are related to technical improvements at the backend level.

RexPreloadAppearance

server->client

string list: Avatar URL addresses.

Each string specifies an avatar URL address that should be preloaded by the client - they will be used in the future.

RexPreloadAssets

server->client

string list: String of the form "AssetType(int)\tassetID(uuid)"

Tells the client that it should preload the given assets from the storage - they will be used in the future.

RexStartup

client->server

UUID: Agent ID
string: State. One of "inventory", "misc", "assets", "started".

Deprecated. Tells the server about the startup progress state of the client.

Entity-Component synchronization

At prototyping phase rexprim freedata was used to store Entity-Component data for entities. But because of the restriction that the data can only be saved for Prims, not for avatars, new messages were made. Rexprim freedata synchronized all components of entity to server. These new messages can synchronize components individually.

ecremove

client<->server

When client sends this message, it asks for this component to be removed. When server sends this message, it says that this component is now removed.

UUID: entity id
string: component type
string: component name

ecsync

server<->client

When client sends this message it asks, this component to be updated or added. When server sends this message, it says this component was added or updated.

UUID: entity id
ecsync: Data

The contents of the Data field are treated in binary, not in ASCII.

struct ecsync
{
  string componentType;
  string componentName;
  byte[] data;
}

ecstring

client->server

Client sends ec data as string instead of binary data. This data is however replicated back to all clients as binary.

UUID: entity id
string: component type
string: component name
string: data

Deprecated Extensions to SLUDP Messages

The following messages were used as extensions to the set of existing SLUDP messages, but their use is now discontinued.

RexImageInfo

server->client

// RexImageInfo
{
	RexImageInfo Low 10000 NotTrusted Unencoded
	{
		ImageInfo		Single
		{	ImageID		LLUUID		}
		{	MediaURL	Variable	1	}
	}
}

RexSkyboxInfo

server->client

// RexSkyboxInfo
{
	RexSkyboxInfo Low 10001 NotTrusted Unencoded
	{
		Textures Single
		{	FrontTextureID		LLUUID }
		{	BackTextureID		  LLUUID }
		{	LeftTextureID		  LLUUID }
		{	RightTextureID		LLUUID }
		{	TopTextureID	  	LLUUID }
		{	BottomTextureID		LLUUID }
	}
}