Apparatus Version 1.22
ECS data-oriented workflow for Unreal Engine.
Public Member Functions | 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

EApparatusStatus PushSubjectTrait (const FSolidSubjectHandle SubjectHandle, UScriptStruct *const TraitType, const void *const TraitData)
 Push an additional trait to a remote version of the subject. More...
 
template<typename T >
EApparatusStatus PushSubjectTrait (const FSolidSubjectHandle SubjectHandle, const T &Trait)
 Push an additional subject trait to its remote version. More...
 
EApparatusStatus PushSubjectTrait (const FSolidSubjectHandle SubjectHandle, UScriptStruct *const TraitType)
 Push an existing subject trait to its remote version. More...
 
template<typename T >
EApparatusStatus PushSubjectTrait (const FSolidSubjectHandle SubjectHandle)
 Push an existing subject trait to its remote version. More...
 
AMechanismGetMechanism () const
 Get the mechanism the bearer belongs to. More...
 
 UNetworkBearerComponent ()
 Construct a default network bearer instance. More...
 

Protected Member Functions

void ClientMechanismReceiveSubject (const uint32 InSubjectNetworkId)
 
void ClientMechanismReceiveSubject_Implementation (const uint32 InSubjectNetworkId)
 Receive a subject on a client. More...
 
EApparatusStatus PeerMechanismReceiveSubjectTrait_Implementation (const EPeerRole PeerRole, const uint32 SubjectNetworkId, UScriptStruct *const TraitType, const TArray< uint8 > &TraitData)
 Receive a subject trait on a peer. More...
 
void ServerMechanismReceiveSubjectTrait (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. More...
 
void ClientMechanismReceiveSubjectTrait (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. More...
 
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. More...
 
void PushSubjectToClient (const uint32 InSubjectNetworkId)
 Send a subject's network identifier to the client's mechanism. More...
 
void PushSubjectToClient (const FSolidSubjectHandle &Subject)
 Send a subject to the client's mechanism. More...
 
void PushSubjectToClient (const uint32 NetworkId, const FSubjectRecord &SubjectRecord)
 Send a subject to the client's mechanism. More...
 
EApparatusStatus DoPushSubjectTrait (const uint32 SubjectNetworkId, UScriptStruct *const TraitType, const void *const TraitData, EPeerRole PeerRole=EPeerRole::None)
 Push an additional subject trait to its remote version. More...
 
template<typename T >
EApparatusStatus DoPushSubjectTrait (const uint32 SubjectNetworkId, const T &Trait, const EPeerRole PeerRole=EPeerRole::None)
 Push an additional subject trait to its remote version. More...
 

Friends

struct FSubjectInfo
 
class AMechanism
 
class UMachine
 

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

◆ 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.

◆ 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/2]

template<typename T >
EApparatusStatus UNetworkBearerComponent::DoPushSubjectTrait ( const uint32  SubjectNetworkId,
const T Trait,
const EPeerRole  PeerRole = EPeerRole::None 
)
inlineprotected

Push an additional subject trait to its remote version.

Internal templated low-level method.

Template Parameters
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::None, the peer role is tried to be derived automatically. This may be ambiguous on a listen server, so you can provide one explicitly.

◆ DoPushSubjectTrait() [2/2]

EApparatusStatus UNetworkBearerComponent::DoPushSubjectTrait ( const uint32  SubjectNetworkId,
UScriptStruct *const  TraitType,
const void *const  TraitData,
EPeerRole  PeerRole = EPeerRole::None 
)
protected

Push an additional subject trait to its remote version.

Internal low-level method.

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::None, the peer role is tried to be derived automatically. This may be ambiguous on a listen server, so you can provide one explicitly.

◆ 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.

◆ 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/4]

template<typename T >
EApparatusStatus UNetworkBearerComponent::PushSubjectTrait ( const FSolidSubjectHandle  SubjectHandle)
inline

Push an existing subject trait to its remote version.

Templated version.

The subject will be brought online automatically, if needed.

Template Parameters
TThe type of the trait to push.
Parameters
SubjectHandleThe handle of the subject to push to. Must be a valid handle to a subject.
Returns
The status of the operation.

◆ PushSubjectTrait() [2/4]

template<typename T >
EApparatusStatus UNetworkBearerComponent::PushSubjectTrait ( const FSolidSubjectHandle  SubjectHandle,
const T Trait 
)
inline

Push an additional subject trait to its remote version.

Templated version.

The subject will be brought online automatically if needed.

Template Parameters
TThe type of the trait to push.
Parameters
SubjectHandleThe handle of the subject to push to. Must be a valid handle to a subject.
TraitThe trait to push.
Returns
The status of the operation.

◆ PushSubjectTrait() [3/4]

EApparatusStatus UNetworkBearerComponent::PushSubjectTrait ( const FSolidSubjectHandle  SubjectHandle,
UScriptStruct *const  TraitType 
)
inline

Push an existing subject trait to its remote version.

The subject will be brought online automatically if needed.

Parameters
SubjectHandleThe handle of the subject to push to. Must be a valid handle to a subject.
TraitTypeThe type of the trait to push. Must not be a nullptr.
Returns
The status of the operation.

◆ PushSubjectTrait() [4/4]

EApparatusStatus UNetworkBearerComponent::PushSubjectTrait ( const FSolidSubjectHandle  SubjectHandle,
UScriptStruct *const  TraitType,
const void *const  TraitData 
)
inline

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

The subject will be brought online automatically if needed.

Parameters
SubjectHandleThe handle of the subject to push to. Must be a valid handle.
TraitTypeThe type of the trait to push. Must not be a nullptr.
TraitDataThe data of the trait to push. Must not e a nullptr.
Returns
The status 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.

Friends And Related Function Documentation

◆ AMechanism

friend class AMechanism
friend

◆ FSubjectInfo

friend struct FSubjectInfo
friend

◆ UMachine

friend class UMachine
friend

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