Apparatus Version 1.23
ECS data-oriented workflow for Unreal Engine.
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Friends | List of all members
UNetworkBearerComponent Class Reference

An actor component for handling the networking logic in a unified way. More...

#include <NetworkBearerComponent.h>

Inheritance diagram for UNetworkBearerComponent:
Inheritance graph
[legend]
Collaboration diagram for UNetworkBearerComponent:
Collaboration graph
[legend]

Public Member Functions

template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm > PushSubjectTrait (const FSolidSubjectHandle &SubjectHandle, UScriptStruct *const TraitType, const void *const TraitData, const bool bReliable=true)
 Push an additional trait to a remote version of the subject.
 
template<EParadigm Paradigm = EParadigm::Default, typename T = void>
TOutcomeIf< Paradigm, IsTraitType< T >()> PushSubjectTrait (const FSolidSubjectHandle SubjectHandle, const T &Trait, const bool bReliable=true)
 Push an additional subject trait to its remote version.
 
template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm > PushSubjectTrait (const FConstSubjectHandle &SubjectHandle, UScriptStruct *const TraitType, const bool bReliable=true)
 Push an existing subject trait to its remote version.
 
template<EParadigm Paradigm, typename T >
auto PushSubjectTrait (const FConstSubjectHandle &SubjectHandle, const bool bReliable=true)
 Push an existing subject trait to its remote version.
 
template<typename T , EParadigm Paradigm = EParadigm::Default>
auto PushSubjectTrait (const FConstSubjectHandle &SubjectHandle, const bool bReliable=true)
 Push an existing subject trait to its remote version.
 
AMechanismGetMechanism () const
 Get the mechanism the bearer belongs to.
 
 UNetworkBearerComponent ()
 Construct a default network bearer instance.
 

Protected Member Functions

void ClientMechanismReceiveSubject (const uint32 InSubjectNetworkId)
 
void ClientMechanismReceiveSubject_Implementation (const uint32 InSubjectNetworkId)
 Receive a subject on a client.
 
EApparatusStatus PeerMechanismReceiveSubjectTrait_Implementation (const EPeerRole PeerRole, const uint32 SubjectNetworkId, UScriptStruct *const TraitType, const TArray< uint8 > &TraitData)
 Receive a subject trait on a peer.
 
bool PeerMechanismReceiveSubjectTrait_Validate (const EPeerRole PeerRole, const uint32 SubjectNetworkId, UScriptStruct *const TraitType, const TArray< uint8 > &TraitData)
 Validate the RPC call.
 
void ServerMechanismReceiveSubjectTrait (const uint32 SubjectNetworkId, UScriptStruct *TraitType, const TArray< uint8 > &TraitData)
 
bool ServerMechanismReceiveSubjectTrait_Validate (const uint32 SubjectNetworkId, UScriptStruct *TraitType, const TArray< uint8 > &TraitData)
 
void ServerMechanismReceiveSubjectTrait_Implementation (const uint32 SubjectNetworkId, UScriptStruct *const TraitType, const TArray< uint8 > &TraitData)
 Receive a subject trait on a server.
 
void ServerMechanismReceiveSubjectTraitUnreliable (const uint32 SubjectNetworkId, UScriptStruct *TraitType, const TArray< uint8 > &TraitData)
 
bool ServerMechanismReceiveSubjectTraitUnreliable_Validate (const uint32 SubjectNetworkId, UScriptStruct *TraitType, const TArray< uint8 > &TraitData)
 
void ServerMechanismReceiveSubjectTraitUnreliable_Implementation (const uint32 SubjectNetworkId, UScriptStruct *const TraitType, const TArray< uint8 > &TraitData)
 Receive a subject trait on a server.
 
void ClientMechanismReceiveSubjectTrait (const uint32 SubjectNetworkId, UScriptStruct *TraitType, const TArray< uint8 > &TraitData)
 
bool ClientMechanismReceiveSubjectTrait_Validate (const uint32 SubjectNetworkId, UScriptStruct *TraitType, const TArray< uint8 > &TraitData)
 
void ClientMechanismReceiveSubjectTraitUnreliable (const uint32 SubjectNetworkId, UScriptStruct *TraitType, const TArray< uint8 > &TraitData)
 
bool ClientMechanismReceiveSubjectTraitUnreliable_Validate (const uint32 SubjectNetworkId, UScriptStruct *TraitType, const TArray< uint8 > &TraitData)
 
void ClientMechanismReceiveSubjectTrait_Implementation (const uint32 SubjectNetworkId, UScriptStruct *const TraitType, const TArray< uint8 > &TraitData)
 Receive a subject trait on a client.
 
void ClientMechanismReceiveSubjectWithTraits (const uint32 InSubjectNetworkId, const TArray< UScriptStruct * > &TraitsTypes, const TArray< uint8 > &TraitsData)
 
void ClientMechanismReceiveSubjectWithTraits_Implementation (const uint32 InSubjectNetworkId, const TArray< UScriptStruct * > &TraitsTypes, const TArray< uint8 > &TraitsData)
 Receive a subject along with its traits on a client.
 
void PushSubjectToClient (const uint32 InSubjectNetworkId)
 Send a subject's network identifier to the client's mechanism.
 
void PushSubjectToClient (const FSolidSubjectHandle &Subject)
 Send a subject to the client's mechanism.
 
void PushSubjectToClient (const uint32 NetworkId, const FSubjectRecord &SubjectRecord)
 Send a subject to the client's mechanism.
 
template<EParadigm Paradigm = EParadigm::DefaultInternal>
TOutcome< Paradigm > DoPushSubjectTrait (const uint32 SubjectNetworkId, UScriptStruct *const TraitType, const void *const TraitData, EPeerRole PeerRole=EPeerRole::Auto, const bool bReliable=true)
 Push an additional subject trait to its remote version.
 
template<EParadigm Paradigm = EParadigm::DefaultInternal>
auto DoPushSubjectTrait (const uint32 SubjectNetworkId, UScriptStruct *const TraitType, const void *const TraitData, const bool bReliable, EPeerRole PeerRole=EPeerRole::Auto)
 Push an additional subject trait to its remote version.
 
template<EParadigm Paradigm = EParadigm::DefaultInternal, typename T = void>
auto DoPushSubjectTrait (const uint32 SubjectNetworkId, const T &Trait, const EPeerRole PeerRole=EPeerRole::Auto, const bool bReliable=true)
 Push an additional subject trait to its remote version.
 
template<EParadigm Paradigm = EParadigm::DefaultInternal, typename T = void>
auto DoPushSubjectTrait (const uint32 SubjectNetworkId, const T &Trait, const bool bReliable, const EPeerRole PeerRole=EPeerRole::Auto)
 Push an additional subject trait to its remote version.
 

Static Protected Member Functions

template<EParadigm Paradigm = EParadigm::DefaultInternal>
static TOutcome< Paradigm > BroadcastTrait (UWorld *const World, const uint32 SubjectNetworkId, UScriptStruct *const TraitType, const void *const TraitData, EPeerRole PeerRole=EPeerRole::Auto, const bool bReliable=true)
 Broadcast a subject trait among all of the available peers through their bearers.
 

Friends

struct FSubjectInfo
 
class AMechanism
 
class UMachine
 
class ISubjective
 

Detailed Description

An actor component for handling the networking logic in a unified way.

This manages the main synchronization functionality for the subjective-less subjects in an Unreal-compatible, transparent way.

You can use the methods of this component directly to fine-grain the traffic.

Constructor & Destructor Documentation

◆ UNetworkBearerComponent()

UNetworkBearerComponent::UNetworkBearerComponent ( )
inline

Construct a default network bearer instance.

Member Function Documentation

◆ BroadcastTrait()

template<EParadigm Paradigm = EParadigm::DefaultInternal>
static TOutcome< Paradigm > UNetworkBearerComponent::BroadcastTrait ( UWorld *const  World,
const uint32  SubjectNetworkId,
UScriptStruct *const  TraitType,
const void *const  TraitData,
EPeerRole  PeerRole = EPeerRole::Auto,
const bool  bReliable = true 
)
staticprotected

Broadcast a subject trait among all of the available peers through their bearers.

Template Parameters
ParadigmThe paradigm to work under.

◆ ClientMechanismReceiveSubject()

void UNetworkBearerComponent::ClientMechanismReceiveSubject ( const uint32  InSubjectNetworkId)
protected

◆ ClientMechanismReceiveSubject_Implementation()

void UNetworkBearerComponent::ClientMechanismReceiveSubject_Implementation ( const uint32  InSubjectNetworkId)
protected

Receive a subject on a client.

RPC implementation.

◆ ClientMechanismReceiveSubjectTrait()

void UNetworkBearerComponent::ClientMechanismReceiveSubjectTrait ( const uint32  SubjectNetworkId,
UScriptStruct *  TraitType,
const TArray< uint8 > &  TraitData 
)
protected

◆ ClientMechanismReceiveSubjectTrait_Implementation()

void UNetworkBearerComponent::ClientMechanismReceiveSubjectTrait_Implementation ( const uint32  SubjectNetworkId,
UScriptStruct *const  TraitType,
const TArray< uint8 > &  TraitData 
)
protected

Receive a subject trait on a client.

RPC implementation.

◆ ClientMechanismReceiveSubjectTrait_Validate()

bool UNetworkBearerComponent::ClientMechanismReceiveSubjectTrait_Validate ( const uint32  SubjectNetworkId,
UScriptStruct *  TraitType,
const TArray< uint8 > &  TraitData 
)
protected

◆ ClientMechanismReceiveSubjectTraitUnreliable()

void UNetworkBearerComponent::ClientMechanismReceiveSubjectTraitUnreliable ( const uint32  SubjectNetworkId,
UScriptStruct *  TraitType,
const TArray< uint8 > &  TraitData 
)
protected

◆ ClientMechanismReceiveSubjectTraitUnreliable_Validate()

bool UNetworkBearerComponent::ClientMechanismReceiveSubjectTraitUnreliable_Validate ( const uint32  SubjectNetworkId,
UScriptStruct *  TraitType,
const TArray< uint8 > &  TraitData 
)
protected

◆ ClientMechanismReceiveSubjectWithTraits()

void UNetworkBearerComponent::ClientMechanismReceiveSubjectWithTraits ( const uint32  InSubjectNetworkId,
const TArray< UScriptStruct * > &  TraitsTypes,
const TArray< uint8 > &  TraitsData 
)
protected

◆ ClientMechanismReceiveSubjectWithTraits_Implementation()

void UNetworkBearerComponent::ClientMechanismReceiveSubjectWithTraits_Implementation ( const uint32  InSubjectNetworkId,
const TArray< UScriptStruct * > &  TraitsTypes,
const TArray< uint8 > &  TraitsData 
)
protected

Receive a subject along with its traits on a client.

RPC implementation.

◆ DoPushSubjectTrait() [1/4]

template<EParadigm Paradigm = EParadigm::DefaultInternal, typename T = void>
auto UNetworkBearerComponent::DoPushSubjectTrait ( const uint32  SubjectNetworkId,
const T Trait,
const bool  bReliable,
const EPeerRole  PeerRole = EPeerRole::Auto 
)
inlineprotected

Push an additional subject trait to its remote version.

Internal templated low-level method.

Template Parameters
ParadigmThe paradigm to work under.
TThe type of the trait to push.
Parameters
SubjectNetworkIdThe unique network identifier of the subject to push.
TraitThe trait to push.
bReliableShould reliable channel be used for transaction.
PeerRoleThe peer role specification. If left as EPeerRole::Auto, the peer role is tried to be derived automatically. This may be ambiguous on a listen server, so you can provide one explicitly.
Returns
The outcome of the operation.

◆ DoPushSubjectTrait() [2/4]

template<EParadigm Paradigm = EParadigm::DefaultInternal, typename T = void>
auto UNetworkBearerComponent::DoPushSubjectTrait ( const uint32  SubjectNetworkId,
const T Trait,
const EPeerRole  PeerRole = EPeerRole::Auto,
const bool  bReliable = true 
)
inlineprotected

Push an additional subject trait to its remote version.

Internal templated low-level method.

Template Parameters
ParadigmThe paradigm to work under.
TThe type of the trait to push.
Parameters
SubjectNetworkIdThe unique network identifier of the subject to push.
TraitThe trait to push.
PeerRoleThe peer role specification. If left as EPeerRole::Auto, the peer role is tried to be derived automatically. This may be ambiguous on a listen server, so you can provide one explicitly.
bReliableShould reliable channel be used for transaction.
Returns
The outcome of the operation.

◆ DoPushSubjectTrait() [3/4]

template<EParadigm Paradigm = EParadigm::DefaultInternal>
auto UNetworkBearerComponent::DoPushSubjectTrait ( const uint32  SubjectNetworkId,
UScriptStruct *const  TraitType,
const void *const  TraitData,
const bool  bReliable,
EPeerRole  PeerRole = EPeerRole::Auto 
)
inlineprotected

Push an additional subject trait to its remote version.

Internal low-level method.

Template Parameters
ParadigmThe paradigm to work under.
Parameters
SubjectNetworkIdThe unique network identifier of the subject to push.
TraitTypeThe type of the trait to push. Must not be a nullptr.
TraitDataThe data of the trait to push. Must not e a nullptr.
bReliableShould reliable channel be used for transaction.
PeerRoleThe peer role specification. If left as EPeerRole::Auto, the peer role is tried to be derived automatically. This may be ambiguous on a listen server, so you can provide one explicitly.

◆ DoPushSubjectTrait() [4/4]

template<EParadigm Paradigm = EParadigm::DefaultInternal>
TOutcome< Paradigm > UNetworkBearerComponent::DoPushSubjectTrait ( const uint32  SubjectNetworkId,
UScriptStruct *const  TraitType,
const void *const  TraitData,
EPeerRole  PeerRole = EPeerRole::Auto,
const bool  bReliable = true 
)
protected

Push an additional subject trait to its remote version.

Internal low-level method.

Template Parameters
ParadigmThe paradigm to work under.
Parameters
SubjectNetworkIdThe unique network identifier of the subject to push.
TraitTypeThe type of the trait to push. Must not be a nullptr.
TraitDataThe data of the trait to push. Must not e a nullptr.
PeerRoleThe peer role specification. If left as EPeerRole::Auto, the peer role is tried to be derived automatically. This may be ambiguous on a listen server, so you can provide one explicitly.
bReliableShould reliable channel be used for transaction.

◆ GetMechanism()

AMechanism * UNetworkBearerComponent::GetMechanism ( ) const

Get the mechanism the bearer belongs to.

◆ PeerMechanismReceiveSubjectTrait_Implementation()

EApparatusStatus UNetworkBearerComponent::PeerMechanismReceiveSubjectTrait_Implementation ( const EPeerRole  PeerRole,
const uint32  SubjectNetworkId,
UScriptStruct *const  TraitType,
const TArray< uint8 > &  TraitData 
)
protected

Receive a subject trait on a peer.

Generic RPC implementation.

◆ PeerMechanismReceiveSubjectTrait_Validate()

bool UNetworkBearerComponent::PeerMechanismReceiveSubjectTrait_Validate ( const EPeerRole  PeerRole,
const uint32  SubjectNetworkId,
UScriptStruct *const  TraitType,
const TArray< uint8 > &  TraitData 
)
protected

Validate the RPC call.

Generic version.

◆ PushSubjectToClient() [1/3]

void UNetworkBearerComponent::PushSubjectToClient ( const FSolidSubjectHandle Subject)
protected

Send a subject to the client's mechanism.

◆ PushSubjectToClient() [2/3]

void UNetworkBearerComponent::PushSubjectToClient ( const uint32  InSubjectNetworkId)
protected

Send a subject's network identifier to the client's mechanism.

◆ PushSubjectToClient() [3/3]

void UNetworkBearerComponent::PushSubjectToClient ( const uint32  NetworkId,
const FSubjectRecord SubjectRecord 
)
protected

Send a subject to the client's mechanism.

◆ PushSubjectTrait() [1/5]

template<EParadigm Paradigm, typename T >
auto UNetworkBearerComponent::PushSubjectTrait ( const FConstSubjectHandle SubjectHandle,
const bool  bReliable = true 
)
inline

Push an existing subject trait to its remote version.

Statically typed version.

Warning
The subject won't be brought online automatically, cause the method works on a constant subject.
Template Parameters
ParadigmThe paradigm to work under.
TThe type of the trait to push.
Parameters
[in]SubjectHandleThe handle of the subject to push to. Must be a valid handle to a subject.
[in]bReliableShould reliable channel be used for transaction.
Returns
The outcome of the operation.

◆ PushSubjectTrait() [2/5]

template<typename T , EParadigm Paradigm = EParadigm::Default>
auto UNetworkBearerComponent::PushSubjectTrait ( const FConstSubjectHandle SubjectHandle,
const bool  bReliable = true 
)
inline

Push an existing subject trait to its remote version.

Statically typed default paradigm version.

Warning
The subject won't be brought online automatically, cause the method works on a constant subject.
Template Parameters
TThe type of the trait to push.
ParadigmThe paradigm to work under.
Parameters
[in]SubjectHandleThe handle of the subject to push to. Must be a valid handle to a subject.
[in]bReliableShould reliable channel be used for transaction.
Returns
The outcome of the operation.

◆ PushSubjectTrait() [3/5]

template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm > UNetworkBearerComponent::PushSubjectTrait ( const FConstSubjectHandle SubjectHandle,
UScriptStruct *const  TraitType,
const bool  bReliable = true 
)
inline

Push an existing subject trait to its remote version.

Dynamically typed version.

Warning
The subject won't be brought online automatically, because the method works on a constant subject.
Template Parameters
ParadigmThe paradigm to work under.
Parameters
[in]SubjectHandleThe handle of the subject to push to. Must be a valid handle to a subject.
[in]TraitTypeThe type of the trait to push. Must not be a nullptr.
[in]bReliableShould reliable channel be used for transaction.
Returns
The outcome of the operation.

◆ PushSubjectTrait() [4/5]

template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm > UNetworkBearerComponent::PushSubjectTrait ( const FSolidSubjectHandle SubjectHandle,
UScriptStruct *const  TraitType,
const void *const  TraitData,
const bool  bReliable = true 
)
inline

Push an additional trait to a remote version of the subject.

The subject will be brought online automatically if needed.

Template Parameters
ParadigmThe paradigm to work under.
Parameters
[in]SubjectHandleThe handle of the subject to push to. Must be a valid handle.
[in]TraitTypeThe type of the trait to push. Must not be a nullptr.
[in]TraitDataThe data of the trait to push. Must not e a nullptr.
[in]bReliableShould reliable channel be used for transaction.
Returns
The status of the operation.

◆ PushSubjectTrait() [5/5]

template<EParadigm Paradigm = EParadigm::Default, typename T = void>
TOutcomeIf< Paradigm, IsTraitType< T >()> UNetworkBearerComponent::PushSubjectTrait ( const FSolidSubjectHandle  SubjectHandle,
const T Trait,
const bool  bReliable = true 
)
inline

Push an additional subject trait to its remote version.

Templated version.

The subject will be brought online automatically if needed.

Template Parameters
ParadigmThe paradigm to work under.
TThe type of the trait to push. Must be a trait type.
Parameters
[in]SubjectHandleThe handle of the subject to push to. Must be a valid handle to a subject.
[in]TraitThe trait to push.
[in]bReliableShould reliable channel be used for transaction.
Returns
The outcome of the operation.

◆ ServerMechanismReceiveSubjectTrait()

void UNetworkBearerComponent::ServerMechanismReceiveSubjectTrait ( const uint32  SubjectNetworkId,
UScriptStruct *  TraitType,
const TArray< uint8 > &  TraitData 
)
protected

◆ ServerMechanismReceiveSubjectTrait_Implementation()

void UNetworkBearerComponent::ServerMechanismReceiveSubjectTrait_Implementation ( const uint32  SubjectNetworkId,
UScriptStruct *const  TraitType,
const TArray< uint8 > &  TraitData 
)
protected

Receive a subject trait on a server.

RPC implementation.

◆ ServerMechanismReceiveSubjectTrait_Validate()

bool UNetworkBearerComponent::ServerMechanismReceiveSubjectTrait_Validate ( const uint32  SubjectNetworkId,
UScriptStruct *  TraitType,
const TArray< uint8 > &  TraitData 
)
protected

◆ ServerMechanismReceiveSubjectTraitUnreliable()

void UNetworkBearerComponent::ServerMechanismReceiveSubjectTraitUnreliable ( const uint32  SubjectNetworkId,
UScriptStruct *  TraitType,
const TArray< uint8 > &  TraitData 
)
protected

◆ ServerMechanismReceiveSubjectTraitUnreliable_Implementation()

void UNetworkBearerComponent::ServerMechanismReceiveSubjectTraitUnreliable_Implementation ( const uint32  SubjectNetworkId,
UScriptStruct *const  TraitType,
const TArray< uint8 > &  TraitData 
)
protected

Receive a subject trait on a server.

RPC implementation.

◆ ServerMechanismReceiveSubjectTraitUnreliable_Validate()

bool UNetworkBearerComponent::ServerMechanismReceiveSubjectTraitUnreliable_Validate ( const uint32  SubjectNetworkId,
UScriptStruct *  TraitType,
const TArray< uint8 > &  TraitData 
)
protected

Friends And Related Function Documentation

◆ AMechanism

friend class AMechanism
friend

◆ FSubjectInfo

friend struct FSubjectInfo
friend

◆ ISubjective

friend class ISubjective
friend

◆ UMachine

friend class UMachine
friend

The documentation for this class was generated from the following file: