Room Events and the Notification Listener

Strix handles the synchronization of objects and their actions in the room. However, some events apply to player connections or the state of the room. Being notified of these events can be useful, as the player may need to update things like scoreboards or map information.

The server will notify players connected to a room when these occur, provided the player registers their interest in receiving these notifications with the Notification Listener Component.

Strix Notification Listener Component

The Strix Notification Listener attaches to a Blueprint and is used to trigger behavior when notifications are received.

The Component requires a channel ID under Strix Notifier > Channel ID, which specifies what channel it will listen on.

The Notification Listener Component uses the UE Blueprint event system to notify when events occur. Under Events the Component provides each event, which can be added to the Blueprint by clicking the + icon next to the event. When this room member receives a notification of a given network event, the Unreal event in the graph will be called.

Blueprints may have multiple listeners set to different channels; however, they may only have one Blueprint event per type of notification. Strix provides the channel ID with each notification event so that the channel can be distinguished.

Room Events

Below is a list of the room events and their explanations. Also included are the values that will be provided for each event:

Strix Room Context Open

Called when the current player joins a room. Returns the channel ID.

Strix Room Join Notification Arrived

Called when a player joins a room.
Returns the channel ID and a Strix Room Member struct representing the member that joined the room.

Strix Room Leave Notification Arrived

Called when a player leaves a room.
Returns the channel ID, and a Strix Room Member struct representing the member that left the room.

Strix Room Set Notification Arrived

Called when a player sets the room’s properties.
Returns the channel ID, and a Strix Room Member struct representing the member that set the room.

Strix Room Set Member Notification Arrived

Called when a player sets the properties of a room member.
Returns the channel ID, and a Strix Room Member struct representing the member set.

Strix Room Kick Notification Arrived

Called when a player is kicked.
Returns the channel ID.

Strix Room Delete Notification Arrived

Called when a room is deleted.
Returns the channel ID.

Strix Room Context Closed

Called when the current player is kicked or leaves the room, or the room is deleted.
Returns the channel ID.

Strix Room Owner Changed

Called when the owner of the room changes.
Returns the channel ID, the new Room Owner, and the previous Room Owner.

Note

Events initiated by a player (such as Room Set Member) do not cause a notification for the initiating player. The results of these are handled by success and failure callbacks. Other players in the room will receive notifications.

The exceptions to this rule are the Room Context Open and Room Context Closed events which trigger when the current player enters or exits the room.

Strix Notification Listener Object

To support some advanced use cases, Strix also provides a non-component version of the notification listener: Strix Notification Listener Object. It derives directly from UObject but UActorComponent, so you can use it without any Actor to attach a component to. It provides the same set of room events as the component version.

You can create an instance of the Strix Notification Listener Object in the GameInstance, for example, and listen to any room events independently from levels.

To use it, follow the steps below:

  1. Initialize the Strix Network by calling InitializeStrixNetwork function (or its variant) if you have not yet in the game.

  2. Construct an instance of Strix Notification Listener Object class and keep it in a variable.

  3. Call its Init member function to initialize the instance.

  4. Bind custom event nodes to the listener object.

Using a Strix Notification Listener Object