Rakkarsoft LLC

Peer Function List
Refer to RakPeerInterface.h in /LibrarySource for a detailed explanation of each function.

Core Functions - Functions needed by all users
bool Initialize(unsigned short MaximumNumberOfPeers, unsigned short localPort,int _threadPriority, int maxAvePPS, int timeoutTimeMS);
void InitializeSecurity(char *pubKeyE, char *pubKeyN, char *privKeyP, char *privKeyQ);
void DisableSecurity(void);
void SetMaximumIncomingConnections(unsigned short numberAllowed);
unsigned short GetMaximumIncomingConnections(void) const;
void SetIncomingPassword(char* passwordData, int passwordDataLength);
const BitStream *GetIncomingPassword(void) const;
bool Connect(char* host, unsigned short remotePort, char* passwordData, int passwordDataLength);
void Disconnect(void);
bool IsActive(void) const;
bool GetConnectionList(PlayerID *remoteSystems, unsigned short *numberOfSystems) const;
bool Send(char *data, const long length, PacketPriority priority, PacketReliability reliability, char orderingStream, PlayerID playerId, bool broadcast, bool secured);
bool Send(BitStream* bitStream, PacketPriority priority, PacketReliability reliability, char orderingStream, PlayerID playerId, bool broadcast, bool secured);
Packet* Receive(void);
void DeallocatePacket(Packet *packet);
unsigned short GetMaximumNumberOfPeers(void) const;

Player Management Functions - Functions to manage remote peers
void CloseConnection(PlayerID target, bool sendDisconnectionNotification);
int GetIndexFromPlayerID(PlayerID playerId);
PlayerID GetPlayerIDFromIndex(int index);
void AddToBanList(const char *IP);
void RemoveFromBanList(const char *IP);
void ClearBanList(void);
bool IsBanned(const char *IP);

Ping Functions - Functions dealing with the automatic ping mechanism
void Ping(PlayerID target);
void Ping(char* host, unsigned short serverPort);
int GetAveragePing(PlayerID target);
int GetLastPing(PlayerID target) const;
int GetLowestPing(PlayerID target) const;
void SetOccasionalPing(bool doPing);

Compression Functions - Functions to generate a compression layer
void SetCompileFrequencyTable(bool doCompile);
bool GetOutgoingFrequencyTable(unsigned long outputFrequencyTable[256]);
bool GenerateCompressionLayer(unsigned long inputFrequencyTable[256], bool inputLayer);
bool DeleteCompressionLayer(bool inputLayer);
float GetCompressionRatio(void) const;
float GetDecompressionRatio(void) const;

Remote Procedure Call Functions - Functions to initial and perform RPC
void RegisterAsRemoteProcedureCall(char* uniqueID, void (*functionName)(char *input, int numberOfBitsOfData, PlayerID sender));
void UnregisterAsRemoteProcedureCall(char* uniqueID);
bool RPC(char* uniqueID, char *data, long bitLength, PacketPriority priority, PacketReliability reliability, char orderingStream, PlayerID playerId, bool broadcast, bool secured);
bool RPC(char* uniqueID, BitStream *bitStream, PacketPriority priority, PacketReliability reliability, char orderingStream, PlayerID playerId, bool broadcast, bool secured);

Static Data Functions - Functions dealing with API defined synchronized memory
const BitStream* GetRemoteStaticData(PlayerID playerId) const;
void SetRemoteStaticData(PlayerID playerId, char *data, const long length);
void SendStaticData(PlayerID target);
void SetOfflinePingResponse(char *data, const unsigned long length);

Network Functions - Functions dealing with the network in general
PlayerID GetInternalID(void) const;
PlayerID GetExternalID(PlayerID target) const;
bool SetMTUSize(int size);
int GetMTUSize(void) const;
unsigned GetNumberOfAddresses(void);
const char* GetLocalIP(unsigned int index);
void AdvertiseSystem(char *host, unsigned short remotePort);
void AllowConnectionResponseIPMigration(bool allow);
void AdvertiseSystem(char *host, unsigned short remotePort);

Micellaneous Functions - Other functions
void GetPasswordData(char *passwordData, int *passwordDataLength);
void PushBackPacket(Packet *packet);

Statistical Functions - Functions dealing with API performance
double GetPacketlossPercentile(void);
unsigned long GetTransmittedPacketCount(void);
unsigned long GetTransmittedFrameCount(void);
unsigned long GetLostPacketCount(void);
unsigned long GetReceivedPacketCount(void);
unsigned long GetBytesSent(void);
unsigned long GetBytesReceived(void);
unsigned long GetUnacknowledgedSentPacketListSize(void);
unsigned long GetBytesSentPerSecond(void) const;
unsigned long GetBytesReceivedPerSecond(void) const;
unsigned long GetMaximumWindowSize(void);
unsigned long GetPacketOutputBufferSize(void);
unsigned long GetConnectionTime(PlayerID playerId);
See Also
Index
Server Function List
Client Function List