mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-12-22 22:47:29 +08:00
[raknet] Implement RakPeer::GetDecompressionRatio()
This commit is contained in:
parent
0c4f681066
commit
2f2123f9d3
@ -8,7 +8,7 @@
|
||||
RakPeer::RakPeer()
|
||||
{
|
||||
memset( frequencyTable, 0, sizeof( unsigned int ) * 256 );
|
||||
rawBytesSent = compressedBytesSent = 0;
|
||||
rawBytesSent = rawBytesReceived = compressedBytesSent = compressedBytesReceived = 0;
|
||||
MTUSize = DEFAULT_MTU_SIZE;
|
||||
trackFrequencyTable = false;
|
||||
maximumIncomingConnections = 0;
|
||||
@ -506,9 +506,19 @@ float RakPeer::GetCompressionRatio( void ) const
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
void RakPeer::vftable_E4()
|
||||
// --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Returns:
|
||||
// The decompression ratio. A high decompression ratio is good. Decompression is for incoming data
|
||||
// --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
float RakPeer::GetDecompressionRatio( void ) const
|
||||
{
|
||||
// TODO: RakPeer::vftable_E4() (saco W: 10038B90) (server W: 450670 L: 806E3C0) (bot W: 4045B0 L: 80758BE)
|
||||
if ( rawBytesReceived > 0 )
|
||||
{
|
||||
return ( float ) compressedBytesReceived / ( float ) rawBytesReceived;
|
||||
}
|
||||
|
||||
else
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
void RakPeer::vftable_E8()
|
||||
|
@ -168,7 +168,10 @@ public:
|
||||
/// \return The compression ratio
|
||||
float GetCompressionRatio( void ) const;
|
||||
|
||||
void vftable_E4();
|
||||
///Returns the decompression ratio. A high decompression ratio is good. Decompression is for incoming data
|
||||
/// \return The decompression ratio
|
||||
float GetDecompressionRatio( void ) const;
|
||||
|
||||
void vftable_E8();
|
||||
void vftable_EC();
|
||||
void vftable_F0();
|
||||
@ -208,13 +211,9 @@ protected:
|
||||
|
||||
char _gap7D1[8];
|
||||
|
||||
unsigned int rawBytesSent;
|
||||
unsigned int rawBytesSent, rawBytesReceived, compressedBytesSent, compressedBytesReceived;
|
||||
|
||||
char _gap7DD[4];
|
||||
|
||||
unsigned int compressedBytesSent;
|
||||
|
||||
char _gap7E5[28];
|
||||
char _gap7E9[24];
|
||||
|
||||
RPCMap rpcMap; // Can't use StrPtrHash because runtime insertions will screw up the indices
|
||||
int MTUSize;
|
||||
|
@ -164,7 +164,10 @@ public:
|
||||
/// \return The compression ratio
|
||||
virtual float GetCompressionRatio( void ) const=0;
|
||||
|
||||
virtual void vftable_E4()=0;
|
||||
///Returns the decompression ratio. A high decompression ratio is good. Decompression is for incoming data
|
||||
/// \return The decompression ratio
|
||||
virtual float GetDecompressionRatio( void ) const=0;
|
||||
|
||||
virtual void vftable_E8()=0;
|
||||
virtual void vftable_EC()=0;
|
||||
virtual void vftable_F0()=0;
|
||||
|
Loading…
Reference in New Issue
Block a user