![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <PacketHandler.h>
Inheritance diagram for PacketHandler:Static Public Member Functions | |
| static PACKETHANDLER_API bool | DoesAnyProfileHaveComponent (const FString &InComponentName) |
| static PACKETHANDLER_API bool | DoesProfileHaveComponent (const FName InNetDriverName, const FString &InComponentName) |
| static PACKETHANDLER_API FPacketHandlerAddComponentByNameDelegate & | GetAddComponentByNameDelegate () |
| static PACKETHANDLER_API FPacketHandlerAddComponentDelegate & | GetAddComponentDelegate () |
Public Attributes | |
| UE::Handler::Mode | Mode |
Protected Member Functions | |
| const ProcessedPacket | Incoming_Internal (uint8 *Packet, int32 CountBytes, bool bConnectionless, const TSharedPtr< const FInternetAddr > &Address) |
| PACKETHANDLER_API EIncomingResult | Incoming_Internal (FReceivedPacketView &PacketView) |
| PACKETHANDLER_API const ProcessedPacket | Outgoing_Internal (uint8 *Packet, int32 CountBits, FOutPacketTraits &Traits, bool bConnectionless, const TSharedPtr< const FInternetAddr > &Address) |
This class maintains an array of all PacketHandler Components and forwards incoming and outgoing packets the each component
|
inline |
| PacketHandler::PacketHandler | ( | FDDoSDetection * | InDDoS = nullptr | ) |
Base constructor
| InDDoS | Reference to the owning net drivers DDoS detection handler |
| TSharedPtr< HandlerComponent > PacketHandler::AddHandler | ( | const FString & | ComponentStr, |
| bool | bDeferInitialize = false |
||
| ) |
As above, but initializes from a string specifying the component module, and (optionally) additional options
| ComponentStr | The handler component to load |
| bDeferInitialize | Whether or not to defer triggering Initialize (for batch-adds - code calling this, triggers it instead) |
| void PacketHandler::AddHandler | ( | TSharedPtr< HandlerComponent > & | NewHandler, |
| bool | bDeferInitialize = false |
||
| ) |
Adds a HandlerComponent to the pipeline, prior to initialization (none can be added after initialization)
| NewHandler | The HandlerComponent to add |
| bDeferInitialize | Whether or not to defer triggering Initialize (for batch-adds - code calling this, triggers it instead) |
| void PacketHandler::BeginHandshaking | ( | FPacketHandlerHandshakeComplete | InHandshakeDel = FPacketHandlerHandshakeComplete() | ) |
Triggered by the higher level netcode, to begin any required HandlerComponent handshakes
|
static |
Searches the PacketHandler profile configurations to find if a component is listed.
| InComponentName | The PacketHandler Component to search for |
|
static |
Searches the PacketHandler profile configuration for the given netdriver to find if a component is listed.
| InNetDriverName | The name of the netdriver to search configuration for |
| InComponentName | The component to search for |
|
static |
|
static |
|
inline |
Returns the analytics aggregator
| TSharedPtr< HandlerComponent > PacketHandler::GetComponentByName | ( | FName | ComponentName | ) | const |
Returns a pointer to the first component in the HandlerComponents array with the specified name.
|
inline |
Returns a pointer to the DDoS detection handler
| TSharedPtr< FEncryptionComponent > PacketHandler::GetEncryptionComponent | ( | ) |
Returns a pointer to the component set as the encryption handler, if any.
|
inline |
Returns the analytics provider
| BufferedPacket * PacketHandler::GetQueuedConnectionlessPacket | ( | ) |
Gets a packet from the buffered connectionless packet queue for sending
| BufferedPacket * PacketHandler::GetQueuedPacket | ( | ) |
Gets a packet from the buffered packet queue for sending
| BufferedPacket * PacketHandler::GetQueuedRawPacket | ( | ) |
Gets a packet from the buffered packet queue for sending (as a raw packet)
|
inline |
Whether or not raw packet sends are enabled
| int32 PacketHandler::GetTotalReservedPacketBits | ( | ) |
Gets the combined reserved packet/protocol bits from all handlers, for reserving space in the parent connections packets
| void PacketHandler::HandlerComponentInitialized | ( | HandlerComponent * | InComponent | ) |
Triggered when a child HandlerComponent has been initialized
|
inline |
Processes incoming packets at the PacketHandler level, before any UNetConnection processing takes place on the packet.
Use this for more complex changes to packets, such as compression/encryption, but be aware that compatibility problems with other HandlerComponent's are more likely.
| PacketView | View of the packet being processed - PacketView.Data should be used to return the result |
|
inline |
|
protected |
Internal handling for Incoming/IncomingConnectionless
| PacketView | View of the packet being processed - PacketView.Data should be used to return the result |
|
inlineprotected |
|
inline |
|
inline |
Processes incoming packets without a UNetConnection, in the same manner as 'Incoming' above IMPORTANT: Net drivers triggering this, should call 'UNetDriver::FlushHandler' shortly afterwards, to minimize packet buffering NOTE: Connectionless packets are unreliable.
| PacketView | View of the packet being processed - PacketView.Data should be used to return the result |
| void PacketHandler::IncomingHigh | ( | FBitReader & | Reader | ) |
Processes incoming packets at the UNetConnection level, after uncapping the packet into an FBitReader.
Use this for simple data additions to packets, and for maximum compatibility with other HandlerComponent's.
| Reader | The FBitReader for the incoming packet |
| void PacketHandler::InitFaultRecovery | ( | UE::Net::FNetConnectionFaultRecoveryBase * | InFaultRecovery | ) |
Initializes a reference to the NetConnection fault recovery interface (does not require Engine dependency)
| InFaultRecovery | A reference to the fault recovery interface |
| void PacketHandler::Initialize | ( | UE::Handler::Mode | Mode, |
| uint32 | InMaxPacketBits, | ||
| bool | bConnectionlessOnly = false, |
||
| TSharedPtr< class IAnalyticsProvider > | InProvider = nullptr, |
||
| FDDoSDetection * | InDDoS = nullptr, |
||
| FName | InDriverProfile = NAME_None |
||
| ) |
Handles initialization of manager
| Mode | The mode the manager should be initialized in |
| InMaxPacketBits | The maximum supported packet size |
| bConnectionlessOnly | Whether or not this is a connectionless-only manager (ignores .ini components) |
| InProvider | The analytics provider |
| InDDoS | Reference to the owning net drivers DDoS detection handler |
| InDriverProfile | The PacketHandler configuration profile to use |
| void PacketHandler::InitializeComponents | ( | ) |
Triggers initialization of HandlerComponents.
| void PacketHandler::InitializeDelegates | ( | FPacketHandlerLowLevelSendTraits | InLowLevelSendDel, |
| FPacketHandlerNotifyAddHandler | InAddHandlerDel = FPacketHandlerNotifyAddHandler() |
||
| ) |
Used for external initialization of delegates
| InLowLevelSendDel | The delegate the PacketHandler should use for triggering packet sends |
| InAddHandlerDel | Callback for notifying of new HandlerComponent's |
|
inline |
Whether or not the packet handler is fully initialized, post-handshake etc.
| void PacketHandler::NotifyAnalyticsProvider | ( | TSharedPtr< IAnalyticsProvider > | InProvider, |
| TSharedPtr< FNetAnalyticsAggregator > | InAggregator | ||
| ) |
Notification that the NetDriver analytics provider has been updated (NOT called on first initialization) NOTE: Can also mean disabled, e.g. during hotfix
| InProvider | The analytics provider |
| InAggregator | The net analytics aggregator |
|
inline |
Processes outgoing packets at the PacketHandler level, after all UNetConnection processing.
Use this for more complex changes to packets, such as compression/encryption, but be aware that compatibility problems with other HandlerComponent's are more likely.
| Packet | The packet data to be processed |
| CountBits | The size of the packet data in bits |
| Traits | Traits for the packet, passed down from the NetConnection |
|
protected |
Internal handling for Outgoing/OutgoingConnectionless
| Packet | The packet data to be processed |
| CountBits | The size of the packet data in bits |
| Traits | Traits for the packet, passed down from the NetConnection, if applicable |
| bConnectionless | Whether or not this should be sent as a connectionless packet |
| Address | The address the packet is being sent to |
|
inline |
Processes outgoing packets without a UNetConnection, in the same manner as 'Outgoing' above NOTE: Connectionless packets are unreliable.
| Address | The address the packet is being sent to |
| Packet | The packet data to be processed |
| CountBits | The size of the packet data in bits |
| Traits | Traits for the packet, if applicable |
| void PacketHandler::OutgoingHigh | ( | FBitWriter & | Writer | ) |
Processes outgoing packets at the UNetConnection level, after game data is written, and just before the packet is capped.
Use this for simple data additions to packets, and for maximum compatibility with other HandlerComponent's.
| Writer | The FBitWriter for the outgoing packet |
|
inline |
Queue's a packet to be sent through 'SendHandlerPacket'
| PacketToQueue | The packet to be queued |
|
inline |
Queue's a packet to be sent when the handler is ticked (as a raw packet, since it's already been processed)
| PacketToQueue | The packet to be queued |
| void PacketHandler::SendHandlerPacket | ( | HandlerComponent * | InComponent, |
| FBitWriter & | Writer, | ||
| FOutPacketTraits & | Traits | ||
| ) |
Send a packet originating from a HandlerComponent - will process through the HandlerComponents chain, starting after the triggering component. NOTE: Requires that InitializeDelegates is called, with a valid LowLevelSend delegate.
| Component | The HandlerComponent sending the packet |
| Writer | The packet being sent |
| Traits | The traits applied to the packet, if applicable |
Sets whether or not outgoing packets should bypass this handler - used when raw packet sends are necessary (such as for the stateless handshake)
| bInEnabled | Whether or not raw sends are enabled |
| UE::Handler::Mode PacketHandler.Mode |
Mode of the handler, Client or Server