mirror of
https://github.com/dashr9230/SA-MP.git
synced 2025-01-04 00:23:22 +08:00
[raknet] Implement RakPeer::GetCompressionRatio()
This commit is contained in:
parent
3886884429
commit
0c4f681066
@ -8,6 +8,7 @@
|
|||||||
RakPeer::RakPeer()
|
RakPeer::RakPeer()
|
||||||
{
|
{
|
||||||
memset( frequencyTable, 0, sizeof( unsigned int ) * 256 );
|
memset( frequencyTable, 0, sizeof( unsigned int ) * 256 );
|
||||||
|
rawBytesSent = compressedBytesSent = 0;
|
||||||
MTUSize = DEFAULT_MTU_SIZE;
|
MTUSize = DEFAULT_MTU_SIZE;
|
||||||
trackFrequencyTable = false;
|
trackFrequencyTable = false;
|
||||||
maximumIncomingConnections = 0;
|
maximumIncomingConnections = 0;
|
||||||
@ -490,9 +491,19 @@ void RakPeer::vftable_DC()
|
|||||||
// TODO: RakPeer::vftable_DC() (saco W: 1003ACA0) (server W: 451FE0 L: 806E250) (bot W: 405CD0 L: 80756CC)
|
// TODO: RakPeer::vftable_DC() (saco W: 1003ACA0) (server W: 451FE0 L: 806E250) (bot W: 405CD0 L: 80756CC)
|
||||||
}
|
}
|
||||||
|
|
||||||
void RakPeer::vftable_E0()
|
// --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
// Returns:
|
||||||
|
// The compression ratio. A low compression ratio is good. Compression is for outgoing data
|
||||||
|
// --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
float RakPeer::GetCompressionRatio( void ) const
|
||||||
{
|
{
|
||||||
// TODO: RakPeer::vftable_E0() (saco W: 10038B50) (server W: 450630 L: 806E330) (bot W: 404570 L: 80757FA)
|
if ( rawBytesSent > 0 )
|
||||||
|
{
|
||||||
|
return ( float ) compressedBytesSent / ( float ) rawBytesSent;
|
||||||
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
return 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RakPeer::vftable_E4()
|
void RakPeer::vftable_E4()
|
||||||
|
@ -163,7 +163,11 @@ public:
|
|||||||
|
|
||||||
void vftable_D8();
|
void vftable_D8();
|
||||||
void vftable_DC();
|
void vftable_DC();
|
||||||
void vftable_E0();
|
|
||||||
|
/// Returns the compression ratio. A low compression ratio is good. Compression is for outgoing data
|
||||||
|
/// \return The compression ratio
|
||||||
|
float GetCompressionRatio( void ) const;
|
||||||
|
|
||||||
void vftable_E4();
|
void vftable_E4();
|
||||||
void vftable_E8();
|
void vftable_E8();
|
||||||
void vftable_EC();
|
void vftable_EC();
|
||||||
@ -202,7 +206,15 @@ protected:
|
|||||||
/// Compression stuff
|
/// Compression stuff
|
||||||
unsigned int frequencyTable[ 256 ];
|
unsigned int frequencyTable[ 256 ];
|
||||||
|
|
||||||
char _gap7D1[48];
|
char _gap7D1[8];
|
||||||
|
|
||||||
|
unsigned int rawBytesSent;
|
||||||
|
|
||||||
|
char _gap7DD[4];
|
||||||
|
|
||||||
|
unsigned int compressedBytesSent;
|
||||||
|
|
||||||
|
char _gap7E5[28];
|
||||||
|
|
||||||
RPCMap rpcMap; // Can't use StrPtrHash because runtime insertions will screw up the indices
|
RPCMap rpcMap; // Can't use StrPtrHash because runtime insertions will screw up the indices
|
||||||
int MTUSize;
|
int MTUSize;
|
||||||
|
@ -159,7 +159,11 @@ public:
|
|||||||
|
|
||||||
virtual void vftable_D8()=0;
|
virtual void vftable_D8()=0;
|
||||||
virtual void vftable_DC()=0;
|
virtual void vftable_DC()=0;
|
||||||
virtual void vftable_E0()=0;
|
|
||||||
|
/// Returns the compression ratio. A low compression ratio is good. Compression is for outgoing data
|
||||||
|
/// \return The compression ratio
|
||||||
|
virtual float GetCompressionRatio( void ) const=0;
|
||||||
|
|
||||||
virtual void vftable_E4()=0;
|
virtual void vftable_E4()=0;
|
||||||
virtual void vftable_E8()=0;
|
virtual void vftable_E8()=0;
|
||||||
virtual void vftable_EC()=0;
|
virtual void vftable_EC()=0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user