Cavestory Mod API
Public Member Functions | Public Attributes | List of all members
CaveNet::DataStructures::NetPing Class Reference

Uniform ping calculation. More...

#include <CaveNet_ExportedTypes.h>

Public Member Functions

 NetPing ()
 Constructor.
 
void Reset ()
 Reset.
 
void DoPing ()
 Notify of ping.
 
void MissPing ()
 Notify of missed ping.
 
bool IsLagging ()
 Check if this object is considered 'lagging'. More...
 
bool IsTimedOut ()
 Check if this object can be timed out. More...
 
int GetAverage ()
 Get the average ping. More...
 

Public Attributes

int mLastTime
 Last ping time.
 
int mLastPingTime
 Last sent ping time.
 
int mLastReceiveTime
 Last packet receive time.
 
bool mExpectingPong
 Expecting a pong?
 
int mCurrent
 The current index in mAmount.
 
int mAverage
 The average ping.
 
int mAmount [CAVENET_CLIENT_PINGCACHE]
 List of the amount of time taken for round-trip pings.
 
int mCount
 Number of pings.
 

Detailed Description

Uniform ping calculation.

Member Function Documentation

◆ GetAverage()

int CaveNet::DataStructures::NetPing::GetAverage ( )

Get the average ping.

Returns
int Returns the average ping.

◆ IsLagging()

bool CaveNet::DataStructures::NetPing::IsLagging ( )

Check if this object is considered 'lagging'.

Returns
bool Returns true if this object is considered lagging.

◆ IsTimedOut()

bool CaveNet::DataStructures::NetPing::IsTimedOut ( )

Check if this object can be timed out.

Returns
bool Returns true if this object can be timed out.

The documentation for this class was generated from the following file: