mirror of
https://github.com/dashr9230/SA-MP.git
synced 2026-10-10 19:53:04 +08:00
[raknet] Implement ReliabilityLayer::SetPing(...)
This commit is contained in:
@@ -15,6 +15,28 @@ ReliabilityLayer::ReliabilityLayer()
|
||||
void ReliabilityLayer::InitializeVariables( void )
|
||||
{
|
||||
// TODO: ReliabilityLayer::InitializeVariables
|
||||
|
||||
SetPing( 1000 );
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------
|
||||
// How long to wait between packet resends
|
||||
//-------------------------------------------------------------------------------------------------------
|
||||
void ReliabilityLayer::SetPing( RakNetTime i )
|
||||
{
|
||||
//assert(i < (RakNetTimeNS)timeoutTime*1000);
|
||||
if (i > timeoutTime)
|
||||
ping=500;
|
||||
else
|
||||
ping = i;
|
||||
if (ping < 30)
|
||||
ping=30; // Leave a buffer for variations in ping
|
||||
#ifndef _RELEASE
|
||||
if (ping < (RakNetTime)(minExtraPing+extraPingVariance)*2)
|
||||
ping=(minExtraPing+extraPingVariance)*2;
|
||||
#endif
|
||||
|
||||
UpdateNextActionTime();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user