9#include "NetPing.generated.h"
33 if (
Value >= 1<<16) {
Value >>= 16; Pos += 16; }
37 if (
Value >= 1<< 1) { Pos += 1; }
50 return FMath::FloorLog2(
static_cast<uint32>(PingType));
103static bool IsValidPingType(
EPingType PingType)
113 class FNetPingUDPQoS;
140 class FAverageStorageBase
150 class FNoAverageStorage :
public FAverageStorageBase
154 TSampleMinMaxAvg<EMinMaxValueMode::PerSample> PingValues;
157 class FMovingAverageStorage :
public FAverageStorageBase
161 TSampleMinMaxAvg<EMinMaxValueMode::PerMeasurement> PingValues;
164 TBinnedMovingAvg<
decltype(PingValues), TBinParms::NumBins(4)> PingAccumulator{TBinParms::TimePerBin(1.0)};
168 FMovingAverageStorage();
174 class FPlayerStateAvgStorage :
public FAverageStorageBase
178 uint8 CurPingBucket = 0;
188 double CurPingBucketTimestamp = 0.0;
192 TSampleMinMaxAvg<EMinMaxValueMode::PerMeasurement> PingValues;
209 void RecalculateAvgPing();
310 const FSampleMinMaxAvg& GetPingStorageValues(
EPingType PingType)
const;
319 FAverageStorageBase& GetPingStorageBase(
EPingType PingType);
326 void ResetPingValues(
EPingType PingType);
334 const TCHAR* GetRemoteAddr();
339 FString GetICMPAddr();
344 FString GetUDPQoSAddr();
386 FString CachedRemoteAddr =
TEXT(
"");
389 double NextRemoteAddrCheckTimestamp = 0.0;
410 double NextPingTimerICMPTimestamp = 0.0;
413 double NextPingTimerUDPTimestamp = 0.0;
422 FString OverridePingICMPAddress;
425 FString OverridePingUDPQoSAddress;
431 int32 OverridePingAddressCount = 0;
@ INDEX_NONE
Definition CoreMiscDefines.h:150
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define ENUM_CLASS_FLAGS(Enum)
Definition EnumClassFlags.h:6
ENetPingControlMessage
Definition NetPing.h:90
EPingType
Definition NetPing.h:61
EPingAverageType
Definition NetPing.h:80
#define UENUM(...)
Definition ObjectMacros.h:749
Definition IPAddress.h:22
Definition SharedPointer.h:692
Definition SharedPointer.h:1295
void UpdatePingTimeout(EPingType PingType)
Definition NetPing.cpp:518
static ENGINE_API void HandleNetPingControlMessage(UNetConnection *Connection, ENetPingControlMessage MessageType, FString MessageStr)
Definition NetPing.cpp:894
~FNetPing()
Definition NetPing.cpp:297
static TPimplPtr< FNetPing > CreateNetPing(UNetConnection *InOwner)
Definition NetPing.cpp:310
ENGINE_API FPingValues GetPingValues(EPingType PingType) const
Definition NetPing.cpp:681
void UpdatePing(EPingType PingType, double TimeVal, double PingValue)
Definition NetPing.cpp:464
void TickRealtime(double CurTimeSeconds)
Definition NetPing.cpp:744
EPingType GetPingTypes() const
Definition NetPing.h:273
Definition NetConnection.h:284
Definition OverriddenPropertySet.cpp:45
constexpr int32 PingTypeToIdx(EPingType PingType)
Definition NetPing.h:27
Definition NetworkVersion.cpp:28
TBinnedMovingValue< ConsumerType, NumBins, EBinnedValueMode::MovingAvg > TBinnedMovingAvg
Definition NetStatsUtils.h:306
static constexpr UE_FORCEINLINE_HINT bool IsPowerOfTwo(T Value)
Definition UnrealMathUtility.h:519
Definition PlayerState.h:19
Definition ObjectPtr.h:488
double Max
Definition NetPing.h:128
double Min
Definition NetPing.h:125
double Current
Definition NetPing.h:122