engine
 
载入中...
搜索中...
未找到
类 | 静态 Public 成员函数 | Protected 成员函数 | 静态 Protected 成员函数 | Protected 属性 | 所有成员列表
FPacketAudit类 参考

FPacketAudit 更多...

#include <PacketAudit.h>

类

struct  FScopedAuditAccess
 Provides scoped exclusive access to GSendPacketAudits and GReceivePacketAudits within the .cpp file 更多...
 

静态 Public 成员函数

static FORCEINLINE void AddStage (FString StageName, FBitWriter &OutPacket, bool bByteAligned=false)
 On the send side, marks a named stage during packet writing, which should be audited on the receive side. 更多...
 
static FORCEINLINE void CheckStage (FString StageName, FBitReader &InPacket, bool bByteAligned=false)
 On the receive side, checks to see that a named stage was marked for auditing on the send side, and audits the packet data. 更多...
 
static void Destruct ()
 Destroy GPacketAuditor
 
static void Init ()
 Initialize GPacketAudtor
 
static FORCEINLINE void NotifyLowLevelReceive (FBitReader &InPacket)
 Low level netcode hook, notifying of incoming packets 更多...
 
static FORCEINLINE void NotifyLowLevelSend (FBitWriter &OutPacket)
 Low level netcode hook, notifying of outgoing packets 更多...
 

Protected 成员函数

void DumpAuditData (FScopedAuditAccess &AuditLock, uint32 InPacketCRC=0)
 Dumps the collected packet audit data to the log
 

静态 Protected 成员函数

static uint32 PacketCRC (uint8 *Data, uint32 DataLenBits)
 Gets the CRC of a packet, zeroing any unwritten bits in the last byte beforehand. 更多...
 

Protected 属性

FPlatformProcess::FSemaphore * GameMutex
 Mutex used for enforcing a single instance of client/server packet auditing
 
FPlatformMemory::FSharedMemoryRegion * ReceiveSharedMemory
 Shared memory region for packet receives
 
FPlatformMemory::FSharedMemoryRegion * SendSharedMemory
 Shared memory region for packet sends
 
FPlatformProcess::FSemaphore * SharedMutex
 Mutex used for exclusive access to shared memory
 

详细描述

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.

成员函数说明

◆ AddStage()

static FORCEINLINE void FPacketAudit::AddStage ( FString  StageName,
FBitWriter &  OutPacket,
bool  bByteAligned = false 
)
inlinestatic

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

参数
StageNameThe unique name to provide this stage of packet writing
OutPacketThe packet the data is being written to - used for gathering audit information
bByteAlignedWhether or not to treat the packet as if it is byte aligned (used in rare circumstances)

◆ CheckStage()

static FORCEINLINE void FPacketAudit::CheckStage ( FString  StageName,
FBitReader &  InPacket,
bool  bByteAligned = false 
)
inlinestatic

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

参数
StageNameThe unique name to this stage of packet processing
InPacketThe packet the data is being read from - used for gathering audit information
bByteAlignedWhether or not to treat the packet as if it is byte aligned (used in rare circumstances)

◆ NotifyLowLevelReceive()

static FORCEINLINE void FPacketAudit::NotifyLowLevelReceive ( FBitReader &  InPacket)
inlinestatic

Low level netcode hook, notifying of incoming packets

参数
InPacketThe current incoming packet

◆ NotifyLowLevelSend()

static FORCEINLINE void FPacketAudit::NotifyLowLevelSend ( FBitWriter &  OutPacket)
inlinestatic

Low level netcode hook, notifying of outgoing packets

参数
OutPacketThe current outgoing packet

◆ PacketCRC()

static uint32 FPacketAudit::PacketCRC ( uint8 *  Data,
uint32  DataLenBits 
)
staticprotected

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

参数
DataThe packet data
DataLenBitsThe length of the data, in bits
返回
Returns the CRC of the packet

该类的文档由以下文件生成: