From 608c372b11058b12246606361934a7a364f3dbe8 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Sun, 14 Apr 2024 22:29:40 +0800 Subject: [PATCH] [raknet] Update `ReliabilityLayer::InitializeVariables()` --- raknet/ReliabilityLayer.cpp | 13 +++++++++++++ raknet/ReliabilityLayer.h | 9 ++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/raknet/ReliabilityLayer.cpp b/raknet/ReliabilityLayer.cpp index 2c66655..78f13a3 100644 --- a/raknet/ReliabilityLayer.cpp +++ b/raknet/ReliabilityLayer.cpp @@ -12,10 +12,23 @@ ReliabilityLayer::ReliabilityLayer() InitializeVariables(); } +//------------------------------------------------------------------------------------------------------- +// Initialize the variables +//------------------------------------------------------------------------------------------------------- void ReliabilityLayer::InitializeVariables( void ) { // TODO: ReliabilityLayer::InitializeVariables + memset( &statistics, 0, sizeof( statistics ) ); + statistics.connectionStartTime = RakNet::GetTime(); + statistics.field_110 = RakNet::GetTime(); + statistics.field_114 = 0; + statistics.field_118 = 0; + statistics.field_11C = RakNet::GetTime(); + statistics.field_120 = 0; + statistics.field_124 = 0; + field_403 = 4; + SetPing( 1000 ); } diff --git a/raknet/ReliabilityLayer.h b/raknet/ReliabilityLayer.h index 3161621..12dc9e5 100644 --- a/raknet/ReliabilityLayer.h +++ b/raknet/ReliabilityLayer.h @@ -5,6 +5,7 @@ #include "SocketLayer.h" #include "MTUSize.h" +#include "RakNetStatistics.h" class ReliabilityLayer { @@ -33,7 +34,13 @@ private: RakNetTime timeoutTime; // How long to wait in MS before timing someone out - char _gap2D7[1014]; + char _gap2D7[4]; + + RakNetStatisticsStruct statistics; + + unsigned int field_403; + + char _gap407[710]; RakNetTimeNS ackTimeIncrement;