Skip to content

PDUProcessor

huggins edited this page May 3, 2023 · 6 revisions

PDU Processor

A class to handle receiving PDUs and triggers the appropriate events

class UPDUProcessor
  : public UGameInstanceSubsystem

Includes

Back to Top


Members

Access Type Name Description
Private DIS::Endian BigEndian The state of the endianness
Private const unsigned int PDU_TYPE_POSITION

Back to Top


Events

Delegate Name Event Name Description
FDetonationPDUProcessed OnDetonationPDUProcessed(FDetonationPDU DetonationPDU) Called after a Detonation PDU is processed
FEntityStatePDUProcessed OnEntityStatePDUProcessed(FEntityStatePDU EntityStatePDU) Called after an Entity State PDU is processed
FEntityStateUpdatePDUProcessed OnEntityStateUpdatePDUProcessed(FEntityStateUpdatePDU EntityStateUpdatePDU) Called after an Entity State Update PDU is processed
FFirePDUProcessed OnFirePDUProcessed(FFirePDU FirePDU) Called after a Fire PDU is processed
FRemoveEntityPDUProcessed OnRemoveEntityPDUProcessed(FRemoveEntityPDU RemoveEntityPDU) Called after a RemoveEntity PDU is processed
FStartResumePDUProcessed OnStartResumePDUProcessed(FStartResumePDU StartResumePDU) Called after a Start/Resume PDU is processed
FStopFreezePDUProcessed OnStopFreezePDUProcessed(FStopFreezePDU StopFreezePDU) Called after a Stop/Freeze PDU is processed

Functions

Access Return Name Description
Public virtual void Deinitialize() Deinitializes the subsystem.
Protected void HandleOnReceivedUDPBytes(const TArray<uint8>& Bytes, const FString& IPAddress) Helper function for processing DIS packets. Binds to OnReceivedBytes from the UDPSubsystem.
Public virtual void Initialize(FSubsystemCollectionBase& Collection) Initializes the subsystem.
Public void ProcessDISPacket(TArray<uint8> InData) Processes a given DIS packet to determine the type of packet. Delegates handling of the packet to whatever is bound to the associated PDU type's OnPDUProcessed event.

Back to Top


Details

Big Endian

private DIS::Endian BigEndian = DIS::BIG

The state of the endianness

Back to Top


PDU_TYPE_POSITION

private const unsigned int PDU_TYPE_POSITION = 2

The position of the PDU Type variable in a UDP packet.

Back to Top


On Detonation PDU Processed

public FDetonationPDUProcessed OnDetonationPDUProcessed

Called after a Detonation PDU is processed.

Category: GRILL DIS|PDU Processor|Events

Parameter Description
DetonationPDU The Detonation PDU to be passed to the listeners.

Back to Top


On Entity State PDU Processed

public FEntityStatePDUProcessed OnEntityStatePDUProcessed

Called after an Entity State PDU is processed.

Category: GRILL DIS|PDU Processor|Events

Parameter Description
EntityStatePDU The Entity State PDU to be passed to the listeners.

Back to Top


On Entity State Update PDU Processed

public FEntityStateUpdatePDUProcessed OnEntityStateUpdatePDUProcessed

Called after an Entity State Update PDU is processed.

Category: GRILL DIS|PDU Processor|Events

Parameter Description
EntityStateUpdatePDU The Entity State Update PDU to be passed to the listeners.

Back to Top


On Fire PDU Processed

public FFirePDUProcessed OnFirePDUProcessed

Called after a Fire PDU is processed.

Category: GRILL DIS|PDU Processor|Events

Parameter Description
FirePDU The Fire PDU to be passed to the listeners.

Back to Top


On Remove Entity PDU Processed

public FRemoveEntityPDUProcessed OnRemoveEntityPDUProcessed

Called after a Remove Entity PDU is processed.

Category: GRILL DIS|PDU Processor|Events

Parameter Description
RemoveEntityPDU The Remove Entity PDU to be passed to the listeners.

Back to Top


On Start Resume PDU Processed

public FStartResumePDUProcessed OnStartResumePDUProcessed

Called after a Start/Resume PDU is processed.

Category: GRILL DIS|PDU Processor|Events

Parameter Description
StartResumePDU The Start Resume PDU to be passed to the listeners.

Back to Top


On Stop Freeze PDU Processed

public FStopFreezePDUProcessed OnStopFreezePDUProcessed

Called after a Stop/Freeze PDU is processed.

Category: GRILL DIS|PDU Processor|Events

Parameter Description
StopFreezePDU The Stop Freeze PDU to be passed to the listeners.

Back to Top


Deinitialize

public virtual void Deinitialize() override

Deinitializes the subsystem.

Back to Top


Handle On Receive UDP Bytes

protected void HandleOnReceivedUDPBytes
(
	const TArray<uint8>& Bytes,
	const FString& IPAddress
)

Helper function for processing DIS packets. Binds to OnReceivedBytes from the UDPSubsystem.

Parameter Description
Bytes The received UDP bytes to process into a DIS packet.
IPAddress The IP address the UDP bytes were received from.

Back to Top


Initialize

public virtual void Initialize(FSubsystemCollectionBase& Collection) override

Initializes the subsystem.

Parameter Description
Collection The collection of all subsystems.

Back to Top


Process DIS Packets

public void ProcessDISPacket
(
	TArray<uint8> InData
)

Processes a given DIS packet to determine the type of packet. Delegates handling of the packet to whatever is bound to the associated PDU type's OnPDUProcessed event.

Category: GRILL DIS|PDU Processor

Parameter Description
InData The UDP data to process into a DIS packet.

Back to Top


Clone this wiki locally