Skip to main content
Version: 2.x

Room

Nodes to create, connect and close ODIN rooms, send RPCs and messages, and react to room events.

Functions​

NodeTypeDescription
Clear Listen ChannelMask For PeerCallable functionRemoves a previously set per-peer listen channel mask override, falling back to the default set via SetListenChannelMask for that peer.
Close RoomCallable functionLeaves the room gracefully: the local peer leaves the room on the server, every peer that was announced through On Peer Joined is reported through On Peer Left, the room status changes to closed, and the native room is freed (at the latest after two seconds).
Connect RoomCallable functionConnects the room to an ODIN gateway and joins it with the given authentication token.
Construct RoomCallable functionCreates a new ODIN room object.
Free RoomCallable functionReleases the native room immediately, without waiting for the server to confirm that the local peer left.
Get Connection StatsPure functionReturns statistics of the room's connection: the UDP datagrams and bytes sent and received, and the round-trip time.
Get Decoders by PeerPure functionReturns all decoders that are registered for the given peer of this room (see Register Decoder to Peer).
Get Odin Room NamePure functionReturns the name of the room as reported by the native room handle.
Get own Peer IDPure functionRetrieves the Peer ID assigned to the local client by the ODIN server.
Get Reconnect TokenPure functionReturns the latest reconnect token the server issued for this room (see On New Reconnect Token).
Get Room NamePure functionReturns the ID of the joined room, as reported by On Room Joined.
Is ClosingPure functionWhether CloseRoom was called and the native room has not been freed yet.
Is ConnectedPure functionReturns true if the client is currently connected to the ODIN server and the room session is active.
Open SocketCallable functionOpens a socket to a peer in this room, or to all peers with a Target Peer Id of 0.
Remove All SocketsCallable functionCloses and removes all sockets of this room.
Remove Peer SocketsCallable functionClose and remove all sockets whose remote peer is the given peer.
Send AudioCallable functionDrain Encoder pipline for audio data and sends encoded voice packets to the server.
Send ChangeSelf RpcCallable functionUpdates the local peer's User Data.
Send Message RpcCallable functionSends an arbitrary data message to a specific list of peers.
Send RpcCallable functionSends a custom RPC to the server.
Send SetChannelMasks RpcCallable functionSends the channel masks the local peer listens to, per remote peer.
Set Crypto PasswordPure functionSets the shared secret of the room's crypto extension from a password.
Set Listen ChannelMaskCallable functionSets the channel mask used when listening to peers that do not have a per-peer override set via SetListenChannelMaskForPeer.
Set Listen ChannelMask For PeerCallable functionOverrides the channel mask used when listening to a specific peer, taking precedence over the default set via SetListenChannelMask.

Events​

EventRaised byDescription
On Message ReceivedOdin RoomEvent triggered when an arbitrary message is received from a peer.
On New Reconnect TokenOdin RoomEvent triggered when the server issues a new reconnect token.
On Peer ChangedOdin RoomEvent triggered when a remote peer updates their user data.
On Peer JoinedOdin RoomEvent triggered when a remote peer joins the room.
On Peer LeftOdin RoomEvent triggered when a remote peer leaves the room.
On Room ErrorOdin RoomRaised when the server reports an error for this room.
On Room JoinedOdin RoomEvent triggered when the local client has successfully joined the room.
On Room Status ChangedOdin RoomRaised when the connection status of the room changes: joining while (re)connecting, joined once the room is joined, and closed after the room was closed.
On RpcOdin RoomRaised for every RPC the server sends to this room, with the raw JSON.
On SocketOdin RoomRaised when a message arrives on any socket of this room.

Properties​

Variables that Blueprints can read (Get) and, where noted, write (Set) directly on an object of the class.

PropertyClassTypeAccessDescription
CryptoOdin RoomOdin CryptoGet/SetOptional instance of pluggable encryption module for room communications. A cipher can be attached to the room on creation to enable customizable, end-to-end encryption(E2EE). Needs ODIN_USE_CRYPTO with CryptoExtention and associated library.