UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
HandlerComponent Class Referenceabstract

#include <PacketHandler.h>

+ Inheritance diagram for HandlerComponent:

Public Member Functions

PACKETHANDLER_API HandlerComponent ()
 
PACKETHANDLER_API HandlerComponent (FName InName)
 
virtual PACKETHANDLER_API ~HandlerComponent ()
 
virtual PACKETHANDLER_API bool IsActive () const
 
virtual bool IsValid () const =0
 
PACKETHANDLER_API bool IsInitialized () const
 
bool RequiresHandshake () const
 
bool RequiresReliability () const
 
virtual void Incoming (FBitReader &Packet)
 
virtual void Incoming (FIncomingPacketRef PacketRef)
 
virtual void Outgoing (FBitWriter &Packet, FOutPacketTraits &Traits)
 
virtual void IncomingConnectionless (FIncomingPacketRef PacketRef)
 
virtual void OutgoingConnectionless (const TSharedPtr< const FInternetAddr > &Address, FBitWriter &Packet, FOutPacketTraits &Traits)
 
virtual bool CanReadUnaligned () const
 
virtual void Initialize ()=0
 
virtual void InitFaultRecovery (UE::Net::FNetConnectionFaultRecoveryBase *InFaultRecovery)
 
virtual void NotifyHandshakeBegin ()
 
virtual void Tick (float DeltaTime)
 
virtual PACKETHANDLER_API void SetActive (bool Active)
 
virtual int32 GetReservedPacketBits () const =0
 
FName GetName () const
 
virtual void NotifyAnalyticsProvider ()
 
virtual PACKETHANDLER_API void CountBytes (FArchive &Ar) const
 

Public Attributes

PacketHandlerHandler
 

Protected Member Functions

PACKETHANDLER_API void SetState (UE::Handler::Component::State State)
 
PACKETHANDLER_API void Initialized ()
 

Protected Attributes

UE::Handler::Component::State State
 
uint32 MaxOutgoingBits
 
bool bRequiresHandshake
 
bool bRequiresReliability
 

Friends

class PacketHandler
 

Detailed Description

This class appends or modifies incoming and outgoing packets on a connection

Constructor & Destructor Documentation

◆ HandlerComponent() [1/2]

HandlerComponent::HandlerComponent ( )

Base constructor

HandlerComponent

◆ HandlerComponent() [2/2]

HandlerComponent::HandlerComponent ( FName  InName)
explicit

Constructor that accepts a name

◆ ~HandlerComponent()

HandlerComponent::~HandlerComponent ( )
virtualdefault

Base destructor

Member Function Documentation

◆ CanReadUnaligned()

virtual bool HandlerComponent::CanReadUnaligned ( ) const
inlinevirtual

Whether or not the Incoming/IncomingConnectionless implementations, support reading Packets that aren't aligned at bit position 0 (i.e. whether or not this handler supports bit-level, rather than byte-level, reads)

Returns
Whether or not the above is supported

Reimplemented in StatelessConnectHandlerComponent.

◆ CountBytes()

void HandlerComponent::CountBytes ( FArchive Ar) const
virtual

◆ GetName()

FName HandlerComponent::GetName ( ) const
inline

Returns the name of this component.

◆ GetReservedPacketBits()

virtual int32 HandlerComponent::GetReservedPacketBits ( ) const
pure virtual

Returns the amount of reserved packet/protocol bits expected from this component.

IMPORTANT: This MUST be accurate, and should represent the worst-case number of reserved bits expected from the component. If this is inaccurate, packets will randomly fail to send, in rare cases which are extremely hard to trace.

Returns
The worst-case reserved packet bits for the component

Implemented in StatelessConnectHandlerComponent.

◆ Incoming() [1/2]

virtual void HandlerComponent::Incoming ( FBitReader Packet)
inlinevirtual

◆ Incoming() [2/2]

virtual void HandlerComponent::Incoming ( FIncomingPacketRef  PacketRef)
inlinevirtual

Handles incoming packets

Parameters
PacketRefReference of the packet being processed

◆ IncomingConnectionless()

virtual void HandlerComponent::IncomingConnectionless ( FIncomingPacketRef  PacketRef)
inlinevirtual

Handles incoming packets not associated with a UNetConnection

Parameters
PacketRefReference of the packet being processed

Reimplemented in StatelessConnectHandlerComponent.

◆ InitFaultRecovery()

virtual void HandlerComponent::InitFaultRecovery ( UE::Net::FNetConnectionFaultRecoveryBase *  InFaultRecovery)
inlinevirtual

Initializes a reference to the NetConnection fault recovery interface (does not require Engine dependency)

Parameters
InFaultRecoveryA reference to the fault recovery interface

◆ Initialize()

virtual void HandlerComponent::Initialize ( )
pure virtual

Initialization functionality should be placed here

Implemented in StatelessConnectHandlerComponent.

◆ Initialized()

void HandlerComponent::Initialized ( )
protected

Should be called when the handler is fully initialized on both remote and local

◆ IsActive()

bool HandlerComponent::IsActive ( ) const
virtual

Returns whether this handler is currently active

◆ IsInitialized()

bool HandlerComponent::IsInitialized ( ) const

Returns whether this handler is initialized

◆ IsValid()

virtual bool HandlerComponent::IsValid ( ) const
pure virtual

Return whether this handler is valid

Implemented in StatelessConnectHandlerComponent.

◆ NotifyAnalyticsProvider()

virtual void HandlerComponent::NotifyAnalyticsProvider ( )
inlinevirtual

Notification that the analytics provider has been updated NOTE: Can also mean disabled, e.g. during hotfix

◆ NotifyHandshakeBegin()

virtual void HandlerComponent::NotifyHandshakeBegin ( )
inlinevirtual

Notification to this component that it is ready to begin handshaking

Reimplemented in StatelessConnectHandlerComponent.

◆ Outgoing()

virtual void HandlerComponent::Outgoing ( FBitWriter Packet,
FOutPacketTraits Traits 
)
inlinevirtual

Handles any outgoing packets

Parameters
PacketThe packet to be handled
TraitsTraits for the packet, passed down through the packet pipeline (likely from the NetConnection)

Reimplemented in StatelessConnectHandlerComponent.

◆ OutgoingConnectionless()

virtual void HandlerComponent::OutgoingConnectionless ( const TSharedPtr< const FInternetAddr > &  Address,
FBitWriter Packet,
FOutPacketTraits Traits 
)
inlinevirtual

Handles any outgoing packets not associated with a UNetConnection

Parameters
AddressThe address the packet is being sent to
PacketThe packet to be handled
TraitsTraits for the packet, passed down through the packet pipeline (if applicable)

◆ RequiresHandshake()

bool HandlerComponent::RequiresHandshake ( ) const
inline

Returns whether this handler perform a network handshake during initialization

◆ RequiresReliability()

bool HandlerComponent::RequiresReliability ( ) const
inline

Returns whether this handler perform a network handshake during initialization

◆ SetActive()

void HandlerComponent::SetActive ( bool  Active)
virtual

Sets whether this handler is currently active

Parameters
ActiveWhether or not the handled should be active

◆ SetState()

void HandlerComponent::SetState ( UE::Handler::Component::State  State)
protected

Sets the state of the handler

Parameters
StateThe new state for the handler

◆ Tick()

virtual void HandlerComponent::Tick ( float  DeltaTime)
inlinevirtual

Tick functionality should be placed here

Reimplemented in StatelessConnectHandlerComponent.

Friends And Related Symbol Documentation

◆ PacketHandler

friend class PacketHandler
friend

Member Data Documentation

◆ bRequiresHandshake

bool HandlerComponent::bRequiresHandshake
protected

Whether this handler has to perform a network handshake during initialization (requires waiting on other HandlerComponent's)

◆ bRequiresReliability

bool HandlerComponent::bRequiresReliability
protected

Whether this handler depends upon the ReliabilityHandlerComponent being enabled

◆ Handler

PacketHandler* HandlerComponent::Handler

The manager of the handler, set in initialization

◆ MaxOutgoingBits

uint32 HandlerComponent::MaxOutgoingBits
protected

Maximum number of Outgoing packet bits supported (automatically calculated to factor in other HandlerComponent reserved bits)

◆ State

UE::Handler::Component::State HandlerComponent::State
protected

The state of this handler


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