FPacketAudit

[FPacketAudit](API\Runtime\NetCore\Net\Core\Misc\FPacketAudit)

Windows
MacOS
Linux

References

Module

NetCore

Header

/Engine/Source/Runtime/Net/Core/Public/Net/Core/Misc/PacketAudit.h

Include

#include "Net/Core/Misc/PacketAudit.h"

Syntax

class FPacketAudit

Remarks

FPacketAudit

Uses inter-process-communication, to audit every stage of packet processing, for verifying that packets are processing properly, and that the client/server are in sync at every stage of reading/writing.

Since this relies on IPC, it is only suitable for testing on a single machine.

IMPORTANT: Only supports interaction between a single server, and a single client.

Variables

Name Description

Protected variable

FPlatformProces...

 

GameMutex

Mutex used for enforcing a single instance of client/server packet auditing

Protected variable

FPlatformMemory...

 

ReceiveSharedMemory

Shared memory region for packet receives

Protected variable

FPlatformMemory...

 

SendSharedMemory

Shared memory region for packet sends

Protected variable

FPlatformProces...

 

SharedMutex

Mutex used for exclusive access to shared memory

Constructors

No constructors are accessible with public or protected access.

Destructors

No destructors are accessible with public or protected access.

Functions

Name Description

Public function Static

void

 

AddStage

(
    FString StageName,
    FBitWriter& OutPacket,
    bool bByteAligned
)

On the send side, marks a named stage during packet writing, which should be audited on the receive side.

Protected function

void

 

AddStage_Internal

(
    FString StageName,
    FBitWriter& OutPacket,
    bool bByteAligned
)

Public function Static

void

 

CheckStage

(
    FString StageName,
    FBitReader& InPacket,
    bool bByteAligned
)

On the receive side, checks to see that a named stage was marked for auditing on the send side, and audits the packet data.

Protected function

void

 

CheckStage_Internal

(
    FString StageName,
    FBitReader& InPacket,
    bool bByteAligned
)

Public function Static

void

 

Destruct()

Destroy GPacketAuditor

Protected function

void

 

DumpAuditData

(
    FScopedAuditAccess& AuditLock,
    uint32 InPacketCRC
)

Dumps the collected packet audit data to the log

Public function Static

void

 

Init()

Initialize GPacketAudtor

Public function Static

void

 

NotifyLowLevelReceive

(
    FBitReader& InPacket
)

Low level netcode hook, notifying of incoming packets

Public function Static

void

 

NotifyLowLevelReceive

(
    uint8* Data,
    uint32 DataLen
)

Protected function

void

 

NotifyLowLevelReceive_Internal

(
    FBitReader& InPacket
)

Public function Static

void

 

NotifyLowLevelSend

(
    FBitWriter& OutPacket
)

Low level netcode hook, notifying of outgoing packets

Public function Static

void

 

NotifyLowLevelSend

(
    uint8* Data,
    uint32 DataLen,
    uint32 DataLenBits
)

Deprecate, once the pipeline uses FBitReader/Writers all the way

Protected function

void

 

NotifyLowLevelSend_Internal

(
    FBitWriter& OutPacket
)

Protected function Static

uint32

 

PacketCRC

(
    uint8* Data,
    uint32 DataLenBits
)

Gets the CRC of a packet, zeroing any unwritten bits in the last byte beforehand.

Classes

Name

Description

Protected struct

FScopedAuditAccess

Provides scoped exclusive access to GSendPacketAudits and GReceivePacketAudits within the .cpp file

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss