Server Function List

Refer to RakServerInterface.h in /LibrarySource for a detailed explanation of each function. Core Functions - Functions needed by all users bool Start(unsigned short AllowedPlayers, unsigned long connectionValidationInteger, bool highPriorityThreads, unsigned short port, int maxAvePPS, int timeoutTimeMS); void InitializeSecurity(char *privateKeyE, char *privateKeyN); void DisableSecurity(void); void SetPassword(char *_password); void Disconnect(void); 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); bool IsActive(void) const; void PushBackPacket(Packet *packet); Player Management Functions - Functions to manage connected clients void Kick(PlayerID playerId); void SetAllowedPlayers(unsigned short AllowedPlayers); unsigned short GetAllowedPlayers(void); unsigned short GetConnectedPlayers(void); void GetPlayerIPFromID(PlayerID playerId, char returnValue[IP_ADDRESS_LENGTH], unsigned short *port); bool IsActivePlayerID(PlayerID playerId); 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 PingPlayer(PlayerID playerId, bool sendReliable=true); int GetAveragePing(PlayerID playerId); int GetLastPing(PlayerID playerId); int GetLowestPing(void) const; void StartOccasionalPing(void); void StopOccasionalPing(void); Synchronized Memory Functions - Functions dealing with user defined synchronized memory unsigned long GetSynchronizedRandomInteger(void) const; void StartSynchronizedRandomInteger(void); void StopSynchronizedRandomInteger(void); Compression Functions - Functions to generate a compression layer bool GenerateCompressionLayer(unsigned long inputFrequencyTable[256], bool inputLayer); bool DeleteCompressionLayer(bool inputLayer); bool GetSendFrequencyTable(unsigned long outputFrequencyTable[256]); 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 RPC(char* uniqueID, BitStream *parameters, PacketPriority priority, PacketReliability reliability, char orderingStream, PlayerID playerId, bool broadcast); bool HandleRPCPacket(Packet* packet); Static Data Functions - Functions dealing with API defined synchronized memory BitStream* GetStaticServerData(void); void SetStaticServerData(char *data, const long length); void SetRelayStaticClientData(bool b); void SendStaticServerDataToClient(PlayerID playerId); void SetOfflinePingResponse(char *data, const unsigned long length); BitStream* GetStaticClientData(PlayerID playerId); void SetStaticClientData(PlayerID playerId, char *data, const long length); void ChangeStaticClientData(PlayerID playerChangedId, PlayerID playerToSendToId); Network Functions - Functions dealing with the network in general unsigned int GetNumberOfAddresses(void); const char* GetServerIP(unsigned int index); bool SetMTUSize(int size); int GetMTUSize(void) const; void AdvertiseSystem(char *host, unsigned short remotePort); 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 Client Function List Peer Function List