mirror of
https://github.com/dashr9230/SA-MP.git
synced 2025-07-18 17:38:12 +08:00
[raknet] Match ReliabilityLayer::GetStatistics(...)
* Update `RakPeer::GetStatistics(...)` * Update `RakPeer::RunUpdateCycle()`
This commit is contained in:
@ -2348,7 +2348,7 @@ RakNetStatisticsStruct * const RakPeer::GetStatistics( const PlayerID playerId )
|
||||
{
|
||||
if (remoteSystemList[ i ].isActive)
|
||||
{
|
||||
systemStats=remoteSystemList[ i ].reliabilityLayer.GetStatistics();
|
||||
systemStats=remoteSystemList[ i ].reliabilityLayer.GetStatistics( true );
|
||||
|
||||
if (firstWrite==true)
|
||||
{
|
||||
@ -2366,7 +2366,7 @@ RakNetStatisticsStruct * const RakPeer::GetStatistics( const PlayerID playerId )
|
||||
RemoteSystemStruct * rss;
|
||||
rss = GetRemoteSystemFromPlayerID( playerId, false, false );
|
||||
if ( rss && endThreads==false )
|
||||
return rss->reliabilityLayer.GetStatistics();
|
||||
return rss->reliabilityLayer.GetStatistics( true );
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -4148,7 +4148,7 @@ bool RakPeer::RunUpdateCycle( void )
|
||||
if (timeMS > remoteSystem->lastReliableSend && timeMS-remoteSystem->lastReliableSend > 5000 && remoteSystem->connectMode==RemoteSystemStruct::CONNECTED)
|
||||
{
|
||||
// If no reliable packets are waiting for an ack, do a one byte reliable send so that disconnections are noticed
|
||||
rnss=remoteSystem->reliabilityLayer.GetStatistics();
|
||||
rnss=remoteSystem->reliabilityLayer.GetStatistics( false );
|
||||
if (rnss->messagesOnResendQueue==0)
|
||||
{
|
||||
unsigned char keepAlive=ID_DETECT_LOST_CONNECTIONS;
|
||||
|
@ -2476,7 +2476,7 @@ void ReliabilityLayer::UpdateNextActionTime(void)
|
||||
//-------------------------------------------------------------------------------------------------------
|
||||
// Statistics
|
||||
//-------------------------------------------------------------------------------------------------------
|
||||
RakNetStatisticsStruct * const ReliabilityLayer::GetStatistics( void )
|
||||
RakNetStatisticsStruct * const ReliabilityLayer::GetStatistics( bool includeResendListDataSize )
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
@ -2494,7 +2494,11 @@ RakNetStatisticsStruct * const ReliabilityLayer::GetStatistics( void )
|
||||
statistics.bitsPerSecond = currentBandwidth;
|
||||
//statistics.lossySize = lossyWindowSize == MAXIMUM_WINDOW_SIZE + 1 ? 0 : lossyWindowSize;
|
||||
// statistics.lossySize=0;
|
||||
statistics.messagesOnResendQueue = GetResendListDataSize();
|
||||
if (!includeResendListDataSize)
|
||||
statistics.messagesOnResendQueue = GetResendListDataSize();
|
||||
else
|
||||
statistics.messagesOnResendQueue = 0;
|
||||
|
||||
|
||||
return &statistics;
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ public:
|
||||
|
||||
/// Get Statistics
|
||||
/// \return A pointer to a static struct, filled out with current statistical information.
|
||||
RakNetStatisticsStruct * const GetStatistics( void );
|
||||
RakNetStatisticsStruct * const GetStatistics( bool includeResendListDataSize );
|
||||
|
||||
///Are we waiting for any data to be sent out or be processed by the player?
|
||||
bool IsDataWaiting(void);
|
||||
|
Reference in New Issue
Block a user