SA-MP/raknet/RakServer.cpp

590 lines
17 KiB
C++
Raw Normal View History

/// \file
///
/// This file is part of RakNet Copyright 2003 Kevin Jenkins.
///
/// Usage of RakNet is subject to the appropriate license agreement.
/// Creative Commons Licensees are subject to the
/// license found at
/// http://creativecommons.org/licenses/by-nc/2.5/
/// Single application licensees are subject to the license found at
/// http://www.rakkarsoft.com/SingleApplicationLicense.html
/// Custom license users are subject to the terms therein.
/// GPL license users are subject to the GNU General Public
/// License as published by the Free
/// Software Foundation; either version 2 of the License, or (at your
/// option) any later version.
2023-11-17 23:45:16 +08:00
#include "RakServer.h"
#include "PacketEnumerations.h"
#include "GetTime.h"
#include "Rand.h"
#ifdef _MSC_VER
#pragma warning( push )
#endif
2023-11-17 23:45:16 +08:00
2024-02-14 22:58:40 +08:00
RakServer::RakServer()
{
nextSeedUpdate = 0;
synchronizedRandomInteger = false;
relayStaticClientData = false;
broadcastPingsTime = 0;
}
RakServer::~RakServer()
{}
void RakServer::InitializeSecurity( const char *pubKeyE, const char *pubKeyN )
{
RakPeer::InitializeSecurity( 0, 0, pubKeyE, pubKeyN );
2024-02-14 22:58:40 +08:00
}
void RakServer::DisableSecurity( void )
2023-11-17 23:45:16 +08:00
{
RakPeer::DisableSecurity();
2023-11-17 23:45:16 +08:00
}
#ifdef _MSC_VER
#pragma warning( disable : 4100 ) // warning C4100: 'depreciated' : unreferenced formal parameter
#endif
bool RakServer::Start( unsigned short AllowedPlayers, unsigned int depreciated, int threadSleepTimer, unsigned short port, const char *forceHostAddress )
2023-11-17 23:45:16 +08:00
{
bool init;
RakPeer::Disconnect( 30 );
init = RakPeer::Initialize( AllowedPlayers, port, threadSleepTimer, forceHostAddress );
RakPeer::SetMaximumIncomingConnections( AllowedPlayers );
2023-11-17 23:45:16 +08:00
// Random number seed
RakNetTime time = RakNet::GetTime();
seedMT( (unsigned int) time );
seed = randomMT();
2023-11-17 23:45:16 +08:00
if ( seed % 2 == 0 ) // Even
seed--; // make odd
nextSeed = randomMT();
if ( nextSeed % 2 == 0 ) // Even
nextSeed--; // make odd
return init;
2023-11-17 23:45:16 +08:00
}
void RakServer::SetPassword( const char *_password )
2023-11-17 23:45:16 +08:00
{
if ( _password )
{
RakPeer::SetIncomingPassword( _password, ( int ) strlen( _password ) + 1 );
}
else
{
RakPeer::SetIncomingPassword( 0, 0 );
}
2023-11-17 23:45:16 +08:00
}
bool RakServer::HasPassword( void )
2023-11-17 23:45:16 +08:00
{
int passwordLength;
GetIncomingPassword(0, &passwordLength);
return passwordLength > 0;
2023-11-17 23:45:16 +08:00
}
void RakServer::Disconnect( unsigned int blockDuration, unsigned char orderingChannel )
2023-11-17 23:45:16 +08:00
{
RakPeer::Disconnect( blockDuration, orderingChannel );
2023-11-17 23:45:16 +08:00
}
bool RakServer::Send( const char *data, const int length, PacketPriority priority, PacketReliability reliability, char orderingChannel, PlayerID playerId, bool broadcast )
2023-11-17 23:45:16 +08:00
{
return RakPeer::Send( data, length, priority, reliability, orderingChannel, playerId, broadcast );
2023-11-17 23:45:16 +08:00
}
bool RakServer::Send( RakNet::BitStream *bitStream, PacketPriority priority, PacketReliability reliability, char orderingChannel, PlayerID playerId, bool broadcast )
2023-11-17 23:45:16 +08:00
{
return RakPeer::Send( bitStream, priority, reliability, orderingChannel, playerId, broadcast );
2023-11-17 23:45:16 +08:00
}
Packet* RakServer::Receive( void )
2023-11-17 23:45:16 +08:00
{
Packet * packet = RakPeer::Receive();
2023-11-17 23:45:16 +08:00
// This is just a regular time based update. Nowhere else good to put it
2023-11-17 23:45:16 +08:00
if ( RakPeer::IsActive() && occasionalPing )
{
RakNetTime time = RakNet::GetTime();
2023-11-17 23:45:16 +08:00
if ( time > broadcastPingsTime || ( packet && packet->data[ 0 ] == ID_RECEIVED_STATIC_DATA ) )
{
if ( time > broadcastPingsTime )
broadcastPingsTime = time + 30000; // Broadcast pings every 30 seconds
unsigned i, count;
RemoteSystemStruct *remoteSystem;
RakNet::BitStream bitStream( ( PlayerID_Size + sizeof( short ) ) * 32 + sizeof(unsigned char) );
unsigned char typeId = ID_BROADCAST_PINGS;
bitStream.Write( typeId );
//for ( i = 0, count = 0; count < 32 && i < remoteSystemListSize; i++ )
for ( i = 0, count = 0; count < 32 && i < maximumNumberOfPeers; i++ )
{
remoteSystem = remoteSystemList + i;
if ( remoteSystem->playerId != UNASSIGNED_PLAYER_ID && remoteSystem->isActive)
{
bitStream.Write( remoteSystem->playerId.binaryAddress );
bitStream.Write( remoteSystem->playerId.port );
bitStream.Write( remoteSystem->pingAndClockDifferential[ remoteSystem->pingAndClockDifferentialWriteIndex ].pingTime );
count++;
}
}
if ( count > 0 ) // If we wrote anything
{
if ( packet && packet->data[ 0 ] == ID_NEW_INCOMING_CONNECTION ) // If this was a new connection
Send( &bitStream, SYSTEM_PRIORITY, RELIABLE, 0, packet->playerId, false ); // Send to the new connection
else
Send( &bitStream, SYSTEM_PRIORITY, RELIABLE, 0, UNASSIGNED_PLAYER_ID, true ); // Send to everyone
}
}
}
// This is just a regular time based update. Nowhere else good to put it
if ( RakPeer::IsActive() && synchronizedRandomInteger )
{
RakNetTime time = RakNet::GetTime();
if ( time > nextSeedUpdate || ( packet && packet->data[ 0 ] == ID_NEW_INCOMING_CONNECTION ) )
{
if ( time > nextSeedUpdate )
nextSeedUpdate = time + 9000; // Seeds are updated every 9 seconds
seed = nextSeed;
nextSeed = randomMT();
if ( nextSeed % 2 == 0 ) // Even
nextSeed--; // make odd
/* SetRandomNumberSeedStruct s;
s.ts = ID_TIMESTAMP;
s.timeStamp = RakNet::GetTime();
s.typeId = ID_SET_RANDOM_NUMBER_SEED;
s.seed = seed;
s.nextSeed = nextSeed;
RakNet::BitStream s_BitS( SetRandomNumberSeedStruct_Size );
s.Serialize( s_BitS );
*/
RakNet::BitStream outBitStream(sizeof(unsigned char)+sizeof(unsigned int)+sizeof(unsigned char)+sizeof(unsigned int)+sizeof(unsigned int));
outBitStream.Write((unsigned char) ID_TIMESTAMP);
outBitStream.Write((unsigned int) RakNet::GetTime());
outBitStream.Write((unsigned char) ID_SET_RANDOM_NUMBER_SEED);
outBitStream.Write(seed);
outBitStream.Write(nextSeed);
if ( packet && packet->data[ 0 ] == ID_NEW_INCOMING_CONNECTION )
Send( &outBitStream, SYSTEM_PRIORITY, RELIABLE, 0, packet->playerId, false );
else
Send( &outBitStream, SYSTEM_PRIORITY, RELIABLE, 0, UNASSIGNED_PLAYER_ID, true );
}
}
if ( packet )
{
// Intercept specific client / server feature packets. This will do an extra send and still pass on the data to the user
if ( packet->data[ 0 ] == ID_RECEIVED_STATIC_DATA )
{
if ( relayStaticClientData )
{
// Relay static data to the other systems but the sender
RakNet::BitStream bitStream( packet->length + PlayerID_Size );
unsigned char typeId = ID_REMOTE_STATIC_DATA;
bitStream.Write( typeId );
bitStream.Write( packet->playerId.binaryAddress );
bitStream.Write( packet->playerId.port );
bitStream.Write( packet->playerIndex );
bitStream.Write( ( char* ) packet->data + sizeof(unsigned char), packet->length - sizeof(unsigned char) );
Send( &bitStream, SYSTEM_PRIORITY, RELIABLE, 0, packet->playerId, true );
}
}
else
if ( packet->data[ 0 ] == ID_DISCONNECTION_NOTIFICATION || packet->data[ 0 ] == ID_CONNECTION_LOST || packet->data[ 0 ] == ID_NEW_INCOMING_CONNECTION )
{
// Relay the disconnection
RakNet::BitStream bitStream( packet->length + PlayerID_Size );
unsigned char typeId;
if ( packet->data[ 0 ] == ID_DISCONNECTION_NOTIFICATION )
typeId = ID_REMOTE_DISCONNECTION_NOTIFICATION;
else
if ( packet->data[ 0 ] == ID_CONNECTION_LOST )
typeId = ID_REMOTE_CONNECTION_LOST;
else
typeId = ID_REMOTE_NEW_INCOMING_CONNECTION;
bitStream.Write( typeId );
bitStream.Write( packet->playerId.binaryAddress );
bitStream.Write( packet->playerId.port );
bitStream.Write( ( unsigned short& ) packet->playerIndex );
Send( &bitStream, SYSTEM_PRIORITY, RELIABLE, 0, packet->playerId, true );
if ( packet->data[ 0 ] == ID_NEW_INCOMING_CONNECTION )
{
unsigned i;
//for ( i = 0; i < remoteSystemListSize; i++ )
for ( i = 0; i < maximumNumberOfPeers; i++ )
{
if ( remoteSystemList[ i ].isActive && remoteSystemList[ i ].playerId != UNASSIGNED_PLAYER_ID && packet->playerId != remoteSystemList[ i ].playerId )
{
bitStream.Reset();
typeId = ID_REMOTE_EXISTING_CONNECTION;
bitStream.Write( typeId );
bitStream.Write( remoteSystemList[ i ].playerId.binaryAddress );
bitStream.Write( remoteSystemList[ i ].playerId.port );
bitStream.Write( ( unsigned short ) i );
// One send to tell them of the connection
Send( &bitStream, SYSTEM_PRIORITY, RELIABLE, 0, packet->playerId, false );
if ( relayStaticClientData )
{
bitStream.Reset();
typeId = ID_REMOTE_STATIC_DATA;
bitStream.Write( typeId );
bitStream.Write( remoteSystemList[ i ].playerId.binaryAddress );
bitStream.Write( remoteSystemList[ i ].playerId.port );
bitStream.Write( (unsigned short) i );
bitStream.Write( ( char* ) remoteSystemList[ i ].staticData.GetData(), remoteSystemList[ i ].staticData.GetNumberOfBytesUsed() );
// Another send to tell them of the static data
Send( &bitStream, SYSTEM_PRIORITY, RELIABLE, 0, packet->playerId, false );
}
}
}
}
}
}
return packet;
}
void RakServer::Kick( const PlayerID playerId )
{
RakPeer::CloseConnection(playerId, true, 0);
}
void RakServer::DeallocatePacket( Packet *packet )
{
RakPeer::DeallocatePacket( packet );
2023-11-17 23:45:16 +08:00
}
void RakServer::SetAllowedPlayers( unsigned short AllowedPlayers )
2023-11-17 23:45:16 +08:00
{
RakPeer::SetMaximumIncomingConnections( AllowedPlayers );
2023-11-17 23:45:16 +08:00
}
unsigned short RakServer::GetAllowedPlayers( void ) const
2023-11-17 23:45:16 +08:00
{
return RakPeer::GetMaximumIncomingConnections();
2023-11-17 23:45:16 +08:00
}
unsigned short RakServer::GetConnectedPlayers( void )
2023-11-17 23:45:16 +08:00
{
unsigned short numberOfSystems;
RakPeer::GetConnectionList( 0, &numberOfSystems );
return numberOfSystems;
2023-11-17 23:45:16 +08:00
}
void RakServer::GetPlayerIPFromID( const PlayerID playerId, char returnValue[ 22 ], unsigned short *port )
2023-11-17 23:45:16 +08:00
{
*port = playerId.port;
strcpy( returnValue, RakPeer::PlayerIDToDottedIP( playerId ) );
2023-11-17 23:45:16 +08:00
}
void RakServer::PingPlayer( const PlayerID playerId )
2023-11-17 23:45:16 +08:00
{
RakPeer::Ping( playerId );
2023-11-17 23:45:16 +08:00
}
int RakServer::GetAveragePing( const PlayerID playerId )
2023-11-17 23:45:16 +08:00
{
return RakPeer::GetAveragePing( playerId );
2023-11-17 23:45:16 +08:00
}
int RakServer::GetLastPing( const PlayerID playerId )
2023-11-17 23:45:16 +08:00
{
return RakPeer::GetLastPing( playerId );
2023-11-17 23:45:16 +08:00
}
int RakServer::GetLowestPing( const PlayerID playerId )
2023-11-17 23:45:16 +08:00
{
return RakPeer::GetLowestPing( playerId );
2023-11-17 23:45:16 +08:00
}
void RakServer::StartOccasionalPing( void )
2023-11-17 23:45:16 +08:00
{
RakPeer::SetOccasionalPing( true );
2023-11-17 23:45:16 +08:00
}
void RakServer::StopOccasionalPing( void )
2023-11-17 23:45:16 +08:00
{
RakPeer::SetOccasionalPing( false );
2023-11-17 23:45:16 +08:00
}
bool RakServer::IsActive( void ) const
2023-11-17 23:45:16 +08:00
{
return RakPeer::IsActive();
2023-11-17 23:45:16 +08:00
}
unsigned int RakServer::GetSynchronizedRandomInteger( void ) const
2023-11-17 23:45:16 +08:00
{
return seed;
2023-11-17 23:45:16 +08:00
}
void RakServer::StartSynchronizedRandomInteger( void )
2023-11-17 23:45:16 +08:00
{
synchronizedRandomInteger = true;
2023-11-17 23:45:16 +08:00
}
void RakServer::StopSynchronizedRandomInteger( void )
2023-11-17 23:45:16 +08:00
{
synchronizedRandomInteger = false;
2023-11-17 23:45:16 +08:00
}
bool RakServer::GenerateCompressionLayer( unsigned int inputFrequencyTable[ 256 ], bool inputLayer )
2023-11-17 23:45:16 +08:00
{
return RakPeer::GenerateCompressionLayer( inputFrequencyTable, inputLayer );
2023-11-17 23:45:16 +08:00
}
bool RakServer::DeleteCompressionLayer( bool inputLayer )
2023-11-17 23:45:16 +08:00
{
return RakPeer::DeleteCompressionLayer( inputLayer );
2023-11-17 23:45:16 +08:00
}
void RakServer::RegisterAsRemoteProcedureCall( char* uniqueID, void ( *functionPointer ) ( RPCParameters *rpcParms ) )
2023-11-17 23:45:16 +08:00
{
RakPeer::RegisterAsRemoteProcedureCall( uniqueID, functionPointer );
2023-11-17 23:45:16 +08:00
}
void RakServer::RegisterClassMemberRPC( char* uniqueID, void *functionPointer )
2023-11-17 23:45:16 +08:00
{
RakPeer::RegisterClassMemberRPC( uniqueID, functionPointer );
2023-11-17 23:45:16 +08:00
}
void RakServer::UnregisterAsRemoteProcedureCall( char* uniqueID )
2023-11-17 23:45:16 +08:00
{
RakPeer::UnregisterAsRemoteProcedureCall( uniqueID );
2023-11-17 23:45:16 +08:00
}
bool RakServer::RPC( char* uniqueID, const char *data, unsigned int bitLength, PacketPriority priority, PacketReliability reliability, char orderingChannel, PlayerID playerId, bool broadcast, bool shiftTimestamp, NetworkID networkID, RakNet::BitStream *replyFromTarget )
2023-11-17 23:45:16 +08:00
{
return RakPeer::RPC( uniqueID, data, bitLength, priority, reliability, orderingChannel, playerId, broadcast, shiftTimestamp, networkID, replyFromTarget );
2023-11-17 23:45:16 +08:00
}
bool RakServer::RPC( char* uniqueID, RakNet::BitStream *parameters, PacketPriority priority, PacketReliability reliability, char orderingChannel, PlayerID playerId, bool broadcast, bool shiftTimestamp, NetworkID networkID, RakNet::BitStream *replyFromTarget )
2023-11-17 23:45:16 +08:00
{
return RakPeer::RPC( uniqueID, parameters, priority, reliability, orderingChannel, playerId, broadcast, shiftTimestamp, networkID, replyFromTarget );
2023-11-17 23:45:16 +08:00
}
void RakServer::SetTrackFrequencyTable( bool b )
2023-11-17 23:45:16 +08:00
{
RakPeer::SetCompileFrequencyTable( b );
2023-11-17 23:45:16 +08:00
}
bool RakServer::GetSendFrequencyTable( unsigned int outputFrequencyTable[ 256 ] )
2023-11-17 23:45:16 +08:00
{
return RakPeer::GetOutgoingFrequencyTable( outputFrequencyTable );
2023-11-17 23:45:16 +08:00
}
float RakServer::GetCompressionRatio( void ) const
2023-11-17 23:45:16 +08:00
{
return RakPeer::GetCompressionRatio();
2023-11-17 23:45:16 +08:00
}
float RakServer::GetDecompressionRatio( void ) const
2023-11-17 23:45:16 +08:00
{
return RakPeer::GetDecompressionRatio();
2023-11-17 23:45:16 +08:00
}
void RakServer::AttachPlugin( PluginInterface *messageHandler )
2023-11-17 23:45:16 +08:00
{
RakPeer::AttachPlugin(messageHandler);
2023-11-17 23:45:16 +08:00
}
void RakServer::DetachPlugin( PluginInterface *messageHandler )
2023-11-17 23:45:16 +08:00
{
RakPeer::DetachPlugin(messageHandler);
2023-11-17 23:45:16 +08:00
}
RakNet::BitStream * RakServer::GetStaticServerData( void )
2023-11-17 23:45:16 +08:00
{
return RakPeer::GetRemoteStaticData( myPlayerId );
2023-11-17 23:45:16 +08:00
}
void RakServer::SetStaticServerData( const char *data, const int length )
2023-11-17 23:45:16 +08:00
{
RakPeer::SetRemoteStaticData( myPlayerId, data, length );
2023-11-17 23:45:16 +08:00
}
void RakServer::SetRelayStaticClientData( bool b )
2023-11-17 23:45:16 +08:00
{
relayStaticClientData = b;
2023-11-17 23:45:16 +08:00
}
void RakServer::SendStaticServerDataToClient( const PlayerID playerId )
2023-11-17 23:45:16 +08:00
{
RakPeer::SendStaticData( playerId );
2023-11-17 23:45:16 +08:00
}
void RakServer::SetOfflinePingResponse( const char *data, const unsigned int length )
2023-11-17 23:45:16 +08:00
{
RakPeer::SetOfflinePingResponse( data, length );
2023-11-17 23:45:16 +08:00
}
RakNet::BitStream * RakServer::GetStaticClientData( const PlayerID playerId )
2023-11-17 23:45:16 +08:00
{
return RakPeer::GetRemoteStaticData( playerId );
2023-11-17 23:45:16 +08:00
}
void RakServer::SetStaticClientData( const PlayerID playerId, const char *data, const int length )
2023-11-17 23:45:16 +08:00
{
RakPeer::SetRemoteStaticData( playerId, data, length );
2023-11-17 23:45:16 +08:00
}
// This will read the data from playerChangedId and send it to playerToSendToId
void RakServer::ChangeStaticClientData( const PlayerID playerChangedId, PlayerID playerToSendToId )
2023-11-17 23:45:16 +08:00
{
RemoteSystemStruct * remoteSystem = GetRemoteSystemFromPlayerID( playerChangedId, false, true );
2023-11-17 23:45:16 +08:00
if ( remoteSystem == 0 )
return ; // No such playerChangedId
2023-11-17 23:45:16 +08:00
// Relay static data to the other systems but the sender
RakNet::BitStream bitStream;
2023-11-17 23:45:16 +08:00
unsigned char typeId = ID_REMOTE_STATIC_DATA;
2023-11-17 23:45:16 +08:00
bitStream.Write( typeId );
2023-11-17 23:45:16 +08:00
bitStream.Write( playerChangedId.binaryAddress );
2023-11-17 23:45:16 +08:00
bitStream.Write( playerChangedId.port );
bitStream.Write( ( char* ) remoteSystem->staticData.GetData(), remoteSystem->staticData.GetNumberOfBytesUsed() );
Send( &bitStream, SYSTEM_PRIORITY, RELIABLE, 0, playerToSendToId, true );
2023-11-17 23:45:16 +08:00
}
unsigned int RakServer::GetNumberOfAddresses( void )
2023-11-17 23:45:16 +08:00
{
return RakPeer::GetNumberOfAddresses();
2023-11-17 23:45:16 +08:00
}
PlayerID RakServer::GetInternalID( void ) const
2023-11-17 23:45:16 +08:00
{
return RakPeer::GetInternalID();
2023-11-17 23:45:16 +08:00
}
void RakServer::PushBackPacket( Packet *packet, bool pushAtHead )
2023-11-17 23:45:16 +08:00
{
RakPeer::PushBackPacket(packet, pushAtHead);
2023-11-17 23:45:16 +08:00
}
void RakServer::SetRouterInterface( RouterInterface *routerInterface )
2023-11-17 23:45:16 +08:00
{
RakPeer::SetRouterInterface(routerInterface);
2023-11-17 23:45:16 +08:00
}
void RakServer::RemoveRouterInterface( RouterInterface *routerInterface )
2023-11-17 23:45:16 +08:00
{
RakPeer::RemoveRouterInterface(routerInterface);
2023-11-17 23:45:16 +08:00
}
const char* RakServer::GetLocalIP( unsigned int index )
2023-11-17 23:45:16 +08:00
{
return RakPeer::GetLocalIP( index );
2023-11-17 23:45:16 +08:00
}
int RakServer::GetIndexFromPlayerID( const PlayerID playerId )
2023-11-17 23:45:16 +08:00
{
return RakPeer::GetIndexFromPlayerID( playerId );
2023-11-17 23:45:16 +08:00
}
PlayerID RakServer::GetPlayerIDFromIndex( int index )
2023-11-17 23:45:16 +08:00
{
return RakPeer::GetPlayerIDFromIndex( index );
2023-11-17 23:45:16 +08:00
}
void RakServer::AddToBanList( const char *IP )
2023-11-17 23:45:16 +08:00
{
RakPeer::AddToBanList( IP );
2023-11-17 23:45:16 +08:00
}
void RakServer::RemoveFromBanList( const char *IP )
2023-11-17 23:45:16 +08:00
{
RakPeer::RemoveFromBanList( IP );
2023-11-17 23:45:16 +08:00
}
void RakServer::ClearBanList( void )
2023-11-17 23:45:16 +08:00
{
RakPeer::ClearBanList();
2023-11-17 23:45:16 +08:00
}
bool RakServer::IsBanned( const char *IP )
2023-11-17 23:45:16 +08:00
{
return RakPeer::IsBanned( IP );
2023-11-17 23:45:16 +08:00
}
bool RakServer::IsActivePlayerID( const PlayerID playerId )
2023-11-17 23:45:16 +08:00
{
return RakPeer::GetRemoteSystemFromPlayerID( playerId, false, true ) != 0;
2023-11-17 23:45:16 +08:00
}
void RakServer::SetTimeoutTime( RakNetTime timeMS, const PlayerID target )
2023-11-17 23:45:16 +08:00
{
RakPeer::SetTimeoutTime(timeMS, target);
2023-11-17 23:45:16 +08:00
}
bool RakServer::SetMTUSize( int size )
2023-11-17 23:45:16 +08:00
{
return RakPeer::SetMTUSize( size );
2023-11-17 23:45:16 +08:00
}
int RakServer::GetMTUSize( void ) const
2023-11-17 23:45:16 +08:00
{
return RakPeer::GetMTUSize();
2023-11-17 23:45:16 +08:00
}
void RakServer::AdvertiseSystem( const char *host, unsigned short remotePort, const char *data, int dataLength )
2023-11-17 23:45:16 +08:00
{
RakPeer::AdvertiseSystem( host, remotePort, data, dataLength );
2023-11-17 23:45:16 +08:00
}
RakNetStatisticsStruct * const RakServer::GetStatistics( const PlayerID playerId )
2023-11-17 23:45:16 +08:00
{
return RakPeer::GetStatistics( playerId );
2023-11-17 23:45:16 +08:00
}
void RakServer::ApplyNetworkSimulator( double maxSendBPS, unsigned short minExtraPing, unsigned short extraPingVariance)
2023-11-17 23:45:16 +08:00
{
RakPeer::ApplyNetworkSimulator( maxSendBPS, minExtraPing, extraPingVariance );
2023-11-17 23:45:16 +08:00
}
bool RakServer::IsNetworkSimulatorActive( void )
2023-11-17 23:45:16 +08:00
{
return RakPeer::IsNetworkSimulatorActive();
2023-11-17 23:45:16 +08:00
}
#ifdef _MSC_VER
#pragma warning( pop )
#endif