Realtime Communication#

The RTC subsystem is a fully functional platform for users to communicate with each other over text, voice or video. Using this system it is possible to create conversations between two or more users that contains rich text, voice or video; including emojis, mentions, media attachments and reactions. In addition, users can split up their conversations into threads, thus making it possible to have multiple levels of dialogue.

Channel#

The Channel is the central point of the RTC system and represents a single conversation between two or more users. Each channel supports text, voice or video communication simultaneously. All text messages in a conversation and any associated reactions are persistent.

Ownership#

A Channel may be owned by a single user or system entity, such as a session, faction/guild, party, etc. Channels that have a user as the owner have full permissions, including the ability to add or remove others to the channel, adjust channel permissions, delete other user messages and delete the channel itself (including all of the channel’s threads).

When a system entity owns a channel, only the system itself will have the powers described above. Users can be granted some additional privileges by adding them to the list of moderators.

Moderators#

Each channel has an optional list of moderators. A moderator has the power to change the Channel topic, add or remove users from the channel and delete other user messages (including entire threads).

Topic#

The topic property allows the channel’s owner or moderators to a basic description about the conversation. Apps implementing the RTC system should support rich text formatting in the topic. The system will automatically perform profanity filtering.

Message#

Users can participate in a channel conversation by posting messages. Each `Message contains some content and an optional set of media attachments.

The content of each message supports rich text formatting in order to process any embedded media, mentions or emojis. When a message is submitted it is automatically processed for mentions and profanity filtering.

Mentions#

A user may mention another by adding a reference in the content of the message. References are formatted as @<uid> where <uid> is the user’s globally unique identifier. When a user is mentioned they are automatically added to the channel’s list of users. This makes it easy for players to bring others into the conversation.

Reactions#

Players can also add reactions to messages by submitting a Reaction. A reaction is simply an emoji response by a given user. The system allows for any type of emoji to be submitted. No validation of the emoji name is performed when submitting a reaction. The responsibility is thus left to the implementing application to decide what types of emojis are supported.

Threads#

The subsystem also supports threaded conversations. A thread is created by submitting a Message to the /channels/:channelUid/messages/:messageUid/threads endpoint. Creating a new thread does three things.

First, a new Channel is created for the thread. The topic of the thread will be the content of the original message that is being threaded. In addition, the channel’s parentUid is set to the uid of the original channel.

Second, the original Message will have it’s threadUid property set to the uid of the newly created channel.

Finally, the message that was submitted to create the thread will have it’s channelUid set to the newly created channel’s uid instead of the original channel of the parent message.

Voice (VOIP)#

The RTC subsystem supports voice communication (VOIP) using either the built-in proxy server or a third-party service. Enabling VOIP support is as simple as defining the voipSettings property on the channel. If no proxy information the built-in proxy server will be assumed and a connection url automatically added to the settings.

Bitrate#

The bitrate configuration setting allows for specifying the bitrate of the audio stream that will be used by clients.

Video#

The RTC subsystem supports video communication using either the built-in proxy server or a third-party service. Enabling video support is as simple as defining the videoSettings property on the channel. If no proxy information the built-in proxy server will be assumed and a connection url automatically added to the settings.

Resolution#

Using the resolution setting allows you to indicate what resolution the video stream will use. For example, if clients will be streaming in 1080p then the resolution setting will have a value of 1080.

Proxy#

Built-in Server#

The RTC subsystem also features an embedded Proxy Server making it easy to implement voice or video communication. The proxy server uses WebSocket and Redis to broadcast data between all connected clients. This makes it easy to build a robust VOIP or video solution that will work for any client.

When no proxy configuration is provided in the channel’s voipSettings or videoSettings configuration the built-in proxy is assumed with configuration automatically set.

To use the built-in proxy server simply create a new WebSocket connection to the provided url in the proxy settings. Once a successful connection is established your client can freely send and receive any binary data. The server will not transform the data sent or received in any way. Note that the proxy server will not echo any messages sent to it from the client.

Third-Party Server#

It is also possible to use a third-party proxy server or communication service with the RTC subsystem. Simpy add the server configuration to the proxy property of the appropriate settings configuration in the channel.