UOdinCrypto
Optional, pluggable encryption module for room communications. A cipher can be attached to an ODIN room handle on creation to enable customizable, end-to-end encryption (E2EE). When enabled, it intercepts data right before transmission and immediately after reception, allowing custom processing of datagrams, messages and custom peer user data. The structure provides a suite of callback functions for initialization, cleanup, event handling and encryption/decryption tasks, along with parameters to adjust for any additional capacity overhead.
- Header:
#include "OdinCryptoExtension.h" - Module:
Odin - Inherits from:
UObject - Blueprint: Blueprintable · Blueprint reference
Overview
Functions
| Name | Description |
|---|---|
ConstructCrypto | |
GetPeerStatus | Returns the encryption state of a peer: Encrypted if it uses the same secret, Invalid Password if it uses a different one, Unencrypted if it joined without encryption, or Unknown. |
GetSecret | |
SetSecret | |
MarkAttachedToRoom | Marks the native cipher as owned by a room. |
IsAttachedToRoom | Whether a room has taken ownership of the native cipher. |
InvalidateHandle | Drops the reference to the native cipher without freeing it (e.g. |
GetHandle | |
SetHandle |
Functions
ConstructCrypto
Overload 1
Static
| Parameter | Type | Description |
|---|---|---|
WorldContextObject | UObject* | |
handle | OdinCipher* |
Returns UOdinCrypto*
Overload 2
Static · Blueprint: Construct Crypto Extension
Creates a crypto extension for end-to-end encryption (E2EE) with the given shared secret. Pass it to the Crypto input of Connect Room. All peers in the room need the same secret to understand each other; check a peer with Get Peer Crypto Status.
| Parameter | Type | Description |
|---|---|---|
WorldContextObject | UObject* | |
Secret | const TArray<uint8>& | The shared secret, e.g. from Odin String To Bytes. You can change it later with Set Crypto Password on the room. |
Returns UOdinCrypto* – The crypto extension.
GetPeerStatus
Blueprint: Get Peer Crypto Status
Returns the encryption state of a peer: Encrypted if it uses the same secret, Invalid Password if it uses a different one, Unencrypted if it joined without encryption, or Unknown.
| Parameter | Type | Description |
|---|---|---|
PeerId | int64 | The remote peer. |
Returns EOdinCryptoPeerStatus – The encryption state of the peer.
GetSecret
Const
Returns TArray<uint8>
SetSecret
| Parameter | Type | Description |
|---|---|---|
NewSecret | const TArray<uint8>& |
MarkAttachedToRoom
Marks the native cipher as owned by a room. The room frees the cipher together with odin_room_free, so this wrapper must not free or re-attach it afterwards.
IsAttachedToRoom
Const
Whether a room has taken ownership of the native cipher.
Returns bool
InvalidateHandle
Drops the reference to the native cipher without freeing it (e.g. after the owning room was freed).
GetHandle
Const · Inline
Returns OdinCipher*
SetHandle
Inline
| Parameter | Type | Description |
|---|---|---|
NewHandle | OdinCipher* |
Properties
Secret
Blueprint: Get/Set
The shared secret of the crypto extension.