Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends

RakPeer Class Reference

Main interface for network communications. More...

#include <RakPeer.h>

Inherits RakPeerInterface.

Collaboration diagram for RakPeer:
Collaboration graph
[legend]

List of all members.

Classes

struct  BanStruct
struct  BufferedCommandStruct
struct  PingAndClockDifferential
struct  RecvFromStruct
struct  RemoteSystemStruct
struct  RequestedConnectionStruct
struct  SocketQueryOutput

Public Member Functions

 RakPeer ()
 Constructor.
virtual ~RakPeer ()
 Destructor.
bool Startup (unsigned short maxConnections, int _threadSleepTimer, SocketDescriptor *socketDescriptors, unsigned socketDescriptorCount, int threadPriority=-99999)
 Starts the network threads and opens the listen port.
void InitializeSecurity (const char *pubKeyE, const char *pubKeyN, const char *privKeyP, const char *privKeyQ)
 Secures connections though a combination of SHA1, AES128, SYN Cookies, and RSA to prevent connection spoofing, replay attacks, data eavesdropping, packet tampering, and MitM attacks.
void DisableSecurity (void)
 Disables all security.
void AddToSecurityExceptionList (const char *ip)
 This is useful if you have a fixed-address internal server behind a LAN.
void RemoveFromSecurityExceptionList (const char *ip)
 Remove a specific connection previously added via AddToSecurityExceptionList.
bool IsInSecurityExceptionList (const char *ip)
 Checks to see if a given IP is in the security exception list.
void SetMaximumIncomingConnections (unsigned short numberAllowed)
 Sets the maximum number of incoming connections allowed.
unsigned short GetMaximumIncomingConnections (void) const
 Returns the value passed to SetMaximumIncomingConnections().
unsigned short NumberOfConnections (void) const
 Returns how many open connections exist at this time.
void SetIncomingPassword (const char *passwordData, int passwordDataLength)
 Sets the password for the incoming connections.
void GetIncomingPassword (char *passwordData, int *passwordDataLength)
 Gets the password passed to SetIncomingPassword.
bool Connect (const char *host, unsigned short remotePort, const char *passwordData, int passwordDataLength, unsigned connectionSocketIndex=0, unsigned sendConnectionAttemptCount=12, unsigned timeBetweenSendConnectionAttemptsMS=500, RakNetTime timeoutTime=0)
 Connect to the specified host (ip or domain name) and server port.
virtual bool ConnectWithSocket (const char *host, unsigned short remotePort, const char *passwordData, int passwordDataLength, RakNetSmartPtr< RakNetSocket > socket, unsigned sendConnectionAttemptCount=12, unsigned timeBetweenSendConnectionAttemptsMS=500, RakNetTime timeoutTime=0)
 Connect to the specified host (ip or domain name) and server port.
void Shutdown (unsigned int blockDuration, unsigned char orderingChannel=0, PacketPriority disconnectionNotificationPriority=LOW_PRIORITY)
 Stops the network threads and closes all connections.
bool IsActive (void) const
 Returns true if the network thread is running.
bool GetConnectionList (SystemAddress *remoteSystems, unsigned short *numberOfSystems) const
 Fills the array remoteSystems with the SystemAddress of all the systems we are connected to.
virtual uint32_t GetNextSendReceipt (void)
virtual uint32_t IncrementNextSendReceipt (void)
uint32_t Send (const char *data, const int length, PacketPriority priority, PacketReliability reliability, char orderingChannel, const AddressOrGUID systemIdentifier, bool broadcast, uint32_t forceReceipt=0)
 Sends a block of data to the specified system that you are connected to.
void SendLoopback (const char *data, const int length)
 "Send" to yourself rather than a remote system.
uint32_t Send (const RakNet::BitStream *bitStream, PacketPriority priority, PacketReliability reliability, char orderingChannel, const AddressOrGUID systemIdentifier, bool broadcast, uint32_t forceReceipt=0)
 Sends a block of data to the specified system that you are connected to.
uint32_t SendList (const char **data, const int *lengths, const int numParameters, PacketPriority priority, PacketReliability reliability, char orderingChannel, const AddressOrGUID systemIdentifier, bool broadcast, uint32_t forceReceipt=0)
 Sends multiple blocks of data, concatenating them automatically.
PacketReceive (void)
 Gets a message from the incoming message queue.
void DeallocatePacket (Packet *packet)
 Call this to deallocate a message returned by Receive() when you are done handling it.
unsigned short GetMaximumNumberOfPeers (void) const
 Return the total number of connections we are allowed.
void RegisterAsRemoteProcedureCall (const char *uniqueID, void(*functionPointer)(RPCParameters *rpcParms))
 Register a C or static member function as available for calling a remote procedure call.
void RegisterClassMemberRPC (const char *uniqueID, void *functionPointer)
 Register a C++ member function as available for calling as a remote procedure call.
void UnregisterAsRemoteProcedureCall (const char *uniqueID)
 Unregisters a C function as available for calling as a remote procedure call that was formerly registered with RegisterAsRemoteProcedureCall. Only call offline.
void SetNetworkIDManager (NetworkIDManager *manager)
 Used by Object member RPC to lookup objects given that object's ID. Also used by the ReplicaManager plugin.
NetworkIDManagerGetNetworkIDManager (void) const
bool RPC (const char *uniqueID, const char *data, BitSize_t bitLength, PacketPriority priority, PacketReliability reliability, char orderingChannel, const AddressOrGUID systemIdentifier, bool broadcast, RakNetTime *includedTimestamp, NetworkID networkID, RakNet::BitStream *replyFromTarget)
bool RPC (const char *uniqueID, const RakNet::BitStream *bitStream, PacketPriority priority, PacketReliability reliability, char orderingChannel, const AddressOrGUID systemIdentifier, bool broadcast, RakNetTime *includedTimestamp, NetworkID networkID, RakNet::BitStream *replyFromTarget)
 Calls a C function on the remote system that was already registered using RegisterAsRemoteProcedureCall.
void CloseConnection (const SystemAddress target, bool sendDisconnectionNotification, unsigned char orderingChannel=0, PacketPriority disconnectionNotificationPriority=LOW_PRIORITY)
 Close the connection to another host (if we initiated the connection it will disconnect, if they did it will kick them out).
void CancelConnectionAttempt (const SystemAddress target)
 Cancel a pending connection attempt.
bool IsConnectionAttemptPending (const SystemAddress systemAddress)
bool IsConnected (const AddressOrGUID systemIdentifier, bool includeInProgress=false, bool includeDisconnecting=false)
 Returns if a particular systemAddress is connected to us.
int GetIndexFromSystemAddress (const SystemAddress systemAddress) const
 Given systemAddress, returns its index into remoteSystemList.
SystemAddress GetSystemAddressFromIndex (int index)
 Given index into remoteSystemList, will return a SystemAddress. This function is only useful for looping through all systems.
RakNetGUID GetGUIDFromIndex (int index)
 Same as GetSystemAddressFromIndex but returns RakNetGUID.
void GetSystemList (DataStructures::List< SystemAddress > &addresses, DataStructures::List< RakNetGUID > &guids)
 Same as calling GetSystemAddressFromIndex and GetGUIDFromIndex for all systems, but more efficient Indices match each other, so addresses[0] and guids[0] refer to the same system.
void AddToBanList (const char *IP, RakNetTime milliseconds=0)
 Bans an IP from connecting.
void RemoveFromBanList (const char *IP)
 Allows a previously banned IP to connect. param[in] Dotted IP address. You can use * as a wildcard. An IP such as 128.0.0.* will ban all IP addresses starting with 128.0.0.
void ClearBanList (void)
 Allows all previously banned IPs to connect.
bool IsBanned (const char *IP)
 Returns true or false indicating if a particular IP is banned.
void SetLimitIPConnectionFrequency (bool b)
 Enable or disable allowing frequent connections from the same IP adderss.
void Ping (const SystemAddress target)
bool Ping (const char *host, unsigned short remotePort, bool onlyReplyOnAcceptingConnections, unsigned connectionSocketIndex=0)
 Send a ping to the specified unconnected system.
int GetAveragePing (const AddressOrGUID systemIdentifier)
 Returns the average of all ping times read for the specific system or -1 if none read yet.
int GetLastPing (const AddressOrGUID systemIdentifier) const
 Returns the last ping time read for the specific system or -1 if none read yet.
int GetLowestPing (const AddressOrGUID systemIdentifier) const
 Returns the lowest ping time read or -1 if none read yet.
void SetOccasionalPing (bool doPing)
void SetOfflinePingResponse (const char *data, const unsigned int length)
 Sets the data to send along with a LAN server discovery or offline ping reply.
void GetOfflinePingResponse (char **data, unsigned int *length)
 Returns pointers to a copy of the data passed to SetOfflinePingResponse.
SystemAddress GetInternalID (const SystemAddress systemAddress=UNASSIGNED_SYSTEM_ADDRESS, const int index=0) const
 Returns the unique address identifier that represents you or another system on the the network and is based on your local IP / port.
SystemAddress GetExternalID (const SystemAddress target) const
 Returns the unique address identifier that represents the target on the the network and is based on the target's external IP / port.
const RakNetGUIDGetGuidFromSystemAddress (const SystemAddress input) const
 Given a connected system address, this method gives the unique GUID representing that instance of RakPeer. This will be the same on all systems connected to that instance of RakPeer, even if the external system addresses are different. Complexity is O(log2(n)). If input is UNASSIGNED_SYSTEM_ADDRESS, will return your own GUID.
SystemAddress GetSystemAddressFromGuid (const RakNetGUID input) const
 Gives the system address of a connected system, given its GUID. The GUID will be the same on all systems connected to that instance of RakPeer, even if the external system addresses are different. Currently O(log(n)), but this may be improved in the future If input is UNASSIGNED_RAKNET_GUID, UNASSIGNED_SYSTEM_ADDRESS is returned.
void SetTimeoutTime (RakNetTime timeMS, const SystemAddress target)
 Set the time, in MS, to use before considering ourselves disconnected after not being able to deliver a reliable message.
RakNetTime GetTimeoutTime (const SystemAddress target)
 Returns the Timeout time for the given system.
int GetMTUSize (const SystemAddress target) const
 Returns the current MTU size.
unsigned GetNumberOfAddresses (void)
 Returns the number of IP addresses this system has internally.
const char * GetLocalIP (unsigned int index)
bool IsLocalIP (const char *ip)
void AllowConnectionResponseIPMigration (bool allow)
 Allow or disallow connection responses from any IP.
bool AdvertiseSystem (const char *host, unsigned short remotePort, const char *data, int dataLength, unsigned connectionSocketIndex=0)
 Sends a one byte message ID_ADVERTISE_SYSTEM to the remote unconnected system. This will send our external IP outside the LAN along with some user data to the remote system.
void SetSplitMessageProgressInterval (int interval)
 Controls how often to return ID_DOWNLOAD_PROGRESS for large message downloads.
int GetSplitMessageProgressInterval (void) const
 Returns what was passed to SetSplitMessageProgressInterval().
void SetUnreliableTimeout (RakNetTime timeoutMS)
 Set how long to wait before giving up on sending an unreliable message. Useful if the network is clogged up. Set to 0 or less to never timeout. Defaults to 0.
void SendTTL (const char *host, unsigned short remotePort, int ttl, unsigned connectionSocketIndex=0)
 Send a message to a host, with the IP socket option TTL set to 3.
void SetCompileFrequencyTable (bool doCompile)
 Enables or disables frequency table tracking.
bool GetOutgoingFrequencyTable (unsigned int outputFrequencyTable[256])
 Returns the frequency of outgoing bytes into outputFrequencyTable The purpose is to save to file as either a master frequency table from a sample game session for passing to GenerateCompressionLayer().
bool GenerateCompressionLayer (unsigned int inputFrequencyTable[256], bool inputLayer)
 This is an optional function to generate the compression layer based on the input frequency table.
bool DeleteCompressionLayer (bool inputLayer)
 Delete the output or input layer as specified.
float GetCompressionRatio (void) const
 Returns the compression ratio.
float GetDecompressionRatio (void) const
 Returns the decompression ratio.
void AttachPlugin (PluginInterface2 *plugin)
 Attatches a Plugin interface to an instance of the base class (RakPeer or PacketizedTCP) to run code automatically on message receipt in the Receive call.
void DetachPlugin (PluginInterface2 *messageHandler)
 Detaches a Plugin interface from the instance of the base class (RakPeer or PacketizedTCP) it is attached to.
void PushBackPacket (Packet *packet, bool pushAtHead)
 Puts a message back in the receive queue in case you don't want to deal with it immediately.
void SetRouterInterface (RouterInterface *routerInterface)
 ------------------------------------------- Deprecated -------------------------
void RemoveRouterInterface (RouterInterface *routerInterface)
void ChangeSystemAddress (RakNetGUID guid, SystemAddress systemAddress)
PacketAllocatePacket (unsigned dataSize)
 Returns a packet for you to write to if you want to create a Packet for some reason. You can add it to the receive buffer with PushBackPacket.
virtual RakNetSmartPtr
< RakNetSocket
GetSocket (const SystemAddress target)
 Get the socket used with a particular active connection. The smart pointer reference counts the RakNetSocket object, so the socket will remain active as long as the smart pointer does, even if RakNet were to shutdown or close the connection.
virtual void GetSockets (DataStructures::List< RakNetSmartPtr< RakNetSocket > > &sockets)
 Gets all sockets in use.
virtual void WriteOutOfBandHeader (RakNet::BitStream *bitStream)
virtual void SetUserUpdateThread (void(*_userUpdateThreadPtr)(RakPeerInterface *, void *), void *_userUpdateThreadData)
void ApplyNetworkSimulator (float packetloss, unsigned short minExtraPing, unsigned short extraPingVariance)
 Adds simulated ping and packet loss to the outgoing data flow.
void SetPerConnectionOutgoingBandwidthLimit (unsigned maxBitsPerSecond)
 Limits how much outgoing bandwidth can be used per-connection. This limit does not apply to the sum of all connections! Exceeding the limit queues up outgoing traffic.
bool IsNetworkSimulatorActive (void)
RakNetStatistics *const GetStatistics (const SystemAddress systemAddress, RakNetStatistics *rns=0)
 Returns a structure containing a large set of network statistics for the specified system. You can map this data to a string using the C style StatisticsToString() function.
bool GetStatistics (const int index, RakNetStatistics *rns)
 Returns the network statistics of the system at the given index in the remoteSystemList.
virtual unsigned int GetReceiveBufferSize (void)
 how many messages are waiting when you call Receive()
char * GetRPCString (const char *data, const BitSize_t bitSize, const SystemAddress systemAddress)
bool SendOutOfBand (const char *host, unsigned short remotePort, const char *data, BitSize_t dataLength, unsigned connectionSocketIndex=0)

Protected Types

enum  { requestedConnectionList_Mutex, offlinePingResponse_Mutex, NUMBER_OF_RAKPEER_MUTEXES }

Protected Member Functions

friend RAK_THREAD_DECLARATION (UpdateNetworkLoop)
friend RAK_THREAD_DECLARATION (RecvFromLoop)
friend RAK_THREAD_DECLARATION (UDTConnect)
PacketReceiveIgnoreRPC (void)
int GetIndexFromSystemAddress (const SystemAddress systemAddress, bool calledFromNetworkThread) const
int GetIndexFromGuid (const RakNetGUID guid)
bool SendConnectionRequest (const char *host, unsigned short remotePort, const char *passwordData, int passwordDataLength, unsigned connectionSocketIndex, unsigned int extraData, unsigned sendConnectionAttemptCount, unsigned timeBetweenSendConnectionAttemptsMS, RakNetTime timeoutTime, RakNetSmartPtr< RakNetSocket > socket)
bool SendConnectionRequest (const char *host, unsigned short remotePort, const char *passwordData, int passwordDataLength, unsigned connectionSocketIndex, unsigned int extraData, unsigned sendConnectionAttemptCount, unsigned timeBetweenSendConnectionAttemptsMS, RakNetTime timeoutTime)
RemoteSystemStructGetRemoteSystemFromSystemAddress (const SystemAddress systemAddress, bool calledFromNetworkThread, bool onlyActive) const
RakPeer::RemoteSystemStructGetRemoteSystem (const AddressOrGUID systemIdentifier, bool calledFromNetworkThread, bool onlyActive) const
void ValidateRemoteSystemLookup (void) const
RemoteSystemStructGetRemoteSystemFromGUID (const RakNetGUID guid, bool onlyActive) const
void ParseConnectionRequestPacket (RakPeer::RemoteSystemStruct *remoteSystem, SystemAddress systemAddress, const char *data, int byteSize)
 Parse out a connection request packet.
void OnConnectionRequest (RakPeer::RemoteSystemStruct *remoteSystem, unsigned char *AESKey, bool setAESKey, RakNetTime incomingTimestamp)
 When we get a connection request from an ip / port, accept it unless full.
void SendConnectionRequestAccepted (RakPeer::RemoteSystemStruct *remoteSystem, RakNetTime incomingTimestamp)
void NotifyAndFlagForShutdown (const SystemAddress systemAddress, bool performImmediate, unsigned char orderingChannel, PacketPriority disconnectionNotificationPriority)
 Send a reliable disconnect packet to this player and disconnect them when it is delivered.
unsigned short GetNumberOfRemoteInitiatedConnections (void) const
 Returns how many remote systems initiated a connection to us.
RemoteSystemStructAssignSystemAddressToRemoteSystemList (const SystemAddress systemAddress, RemoteSystemStruct::ConnectMode connectionMode, RakNetSmartPtr< RakNetSocket > incomingRakNetSocket, bool *thisIPConnectedRecently, SystemAddress bindingAddress, int incomingMTU, RakNetGUID guid)
 Get a free remote system from the list and assign our systemAddress to it.
void ShiftIncomingTimestamp (unsigned char *data, SystemAddress systemAddress) const
 Adjust the timestamp of the incoming packet to be relative to this system.
RakNetTime GetBestClockDifferential (const SystemAddress systemAddress) const
bool HandleRPCPacket (const char *data, int length, SystemAddress systemAddress)
 Handles an RPC packet. This packet has an RPC request.
void HandleRPCReplyPacket (const char *data, int length, SystemAddress systemAddress)
 Handles an RPC reply packet. The reply packet has data returned from an RPC call.
bool IsLoopbackAddress (const AddressOrGUID &systemIdentifier, bool matchPort) const
SystemAddress GetLoopbackAddress (void) const
unsigned int RemoteSystemLookupHashIndex (SystemAddress sa) const
void ReferenceRemoteSystem (SystemAddress sa, unsigned int remoteSystemListIndex)
void DereferenceRemoteSystem (SystemAddress sa)
RemoteSystemStructGetRemoteSystem (SystemAddress sa) const
unsigned int GetRemoteSystemIndex (SystemAddress sa) const
void ClearRemoteSystemLookup (void)
void GenerateSYNCookieRandomNumber (void)
void SecuredConnectionResponse (const SystemAddress systemAddress)
void SecuredConnectionConfirmation (RakPeer::RemoteSystemStruct *remoteSystem, char *data)
bool RunUpdateCycle (void)
bool AllowIncomingConnections (void) const
void PingInternal (const SystemAddress target, bool performImmediate, PacketReliability reliability)
bool ValidSendTarget (SystemAddress systemAddress, bool broadcast)
void CloseConnectionInternal (const AddressOrGUID &systemIdentifier, bool sendDisconnectionNotification, bool performImmediate, unsigned char orderingChannel, PacketPriority disconnectionNotificationPriority)
void SendBuffered (const char *data, BitSize_t numberOfBitsToSend, PacketPriority priority, PacketReliability reliability, char orderingChannel, const AddressOrGUID systemIdentifier, bool broadcast, RemoteSystemStruct::ConnectMode connectionMode, uint32_t receipt)
void SendBufferedList (const char **data, const int *lengths, const int numParameters, PacketPriority priority, PacketReliability reliability, char orderingChannel, const AddressOrGUID systemIdentifier, bool broadcast, RemoteSystemStruct::ConnectMode connectionMode, uint32_t receipt)
bool SendImmediate (char *data, BitSize_t numberOfBitsToSend, PacketPriority priority, PacketReliability reliability, char orderingChannel, const AddressOrGUID systemIdentifier, bool broadcast, bool useCallerDataAllocation, RakNetTimeUS currentTime, uint32_t receipt)
void ClearBufferedCommands (void)
void ClearBufferedPackets (void)
void ClearSocketQueryOutput (void)
void ClearRequestedConnectionList (void)
void AddPacketToProducer (Packet *p)
unsigned int GenerateSeedFromGuid (void)
void DerefAllSockets (void)
unsigned int GetRakNetSocketFromUserConnectionSocketIndex (unsigned int userIndex) const
void GenerateGUID (void)
unsigned int GetSystemIndexFromGuid (const RakNetGUID input) const
PacketAllocPacket (unsigned dataSize, const char *file, unsigned int line)
PacketAllocPacket (unsigned dataSize, unsigned char *data, const char *file, unsigned int line)
void ResetSendReceipt (void)
void OnConnectedPong (RakNetTime sendPingTime, RakNetTime sendPongTime, RemoteSystemStruct *remoteSystem)

Protected Attributes

volatile bool endThreads
 Set this to true to terminate the Peer thread execution.
volatile bool isMainLoopThreadActive
 true if the peer thread is active.
volatile bool isRecvFromLoopThreadActive
bool occasionalPing
*unsigned short maximumNumberOfPeers
 Store the maximum number of peers allowed to connect.
unsigned short maximumIncomingConnections
 Store the maximum number of peers able to connect, including reserved connection slots for pings, etc.
RakNet::BitStream offlinePingResponse
SystemAddress mySystemAddress [MAXIMUM_NUMBER_OF_INTERNAL_IDS]
 Local Player ID.
char incomingPassword [256]
unsigned char incomingPasswordLength
RemoteSystemStructremoteSystemList
RemoteSystemIndex ** remoteSystemLookup
DataStructures::MemoryPool
< RemoteSystemIndex
remoteSystemIndexPool
SimpleMutex rakPeerMutexes [NUMBER_OF_RAKPEER_MUTEXES]
bool updateCycleIsRunning
 RunUpdateCycle is not thread safe but we don't need to mutex calls. Just skip calls if it is running already.
unsigned int bytesSentPerSecond
 The list of people we have tried to connect to recently.
unsigned int bytesReceivedPerSecond
unsigned int validationInteger
SimpleMutex incomingQueueMutex
SimpleMutex banListMutex
DataStructures::List< BanStruct * > banList
DataStructures::List
< PluginInterface2 * > 
messageHandlerList
DataStructures::Queue
< RequestedConnectionStruct * > 
requestedConnectionQueue
SimpleMutex requestedConnectionQueueMutex
unsigned int frequencyTable [256]
 Compression stuff.
HuffmanEncodingTreeinputTree
HuffmanEncodingTreeoutputTree
unsigned int rawBytesSent
unsigned int rawBytesReceived
unsigned int compressedBytesSent
unsigned int compressedBytesReceived
DataStructures::ThreadsafeAllocatingQueue
< BufferedCommandStruct
bufferedCommands
DataStructures::ThreadsafeAllocatingQueue
< RecvFromStruct
bufferedPackets
DataStructures::ThreadsafeAllocatingQueue
< SocketQueryOutput
socketQueryOutput
SimpleMutex securityExceptionMutex
RPCMap rpcMap
int defaultMTUSize
bool trackFrequencyTable
int threadSleepTimer
DataStructures::List
< RakNetSmartPtr< RakNetSocket > > 
socketList
RakNet::BitStreamreplyFromTargetBS
SystemAddress replyFromTargetPlayer
bool replyFromTargetBroadcast
RakNetTime defaultTimeoutTime
bool blockOnRPCReply
RouterInterfacerouter
RakNetGUID myGuid
unsigned maxOutgoingBPS
RSACrypt rsacrypt
 Encryption and security.
uint32_t publicKeyE
uint32_t publicKeyN [RAKNET_RSA_FACTOR_LIMBS]
bool keysLocallyGenerated
bool usingSecurity
RakNetTime randomNumberExpirationTime
unsigned char newRandomNumber [20]
unsigned char oldRandomNumber [20]
bool allowConnectionResponseIPMigration
 How long it has been since things were updated by a call to receiveUpdate thread uses this to determine how long to sleep for.
SystemAddress firstExternalID
int splitMessageProgressInterval
RakNetTime unreliableTimeout
NetworkIDManagernetworkIDManager
DataStructures::List
< RakNet::RakString
securityExceptionList
char ipList [MAXIMUM_NUMBER_OF_INTERNAL_IDS][16]
unsigned int binaryAddresses [MAXIMUM_NUMBER_OF_INTERNAL_IDS]
bool allowInternalRouting
void(* userUpdateThreadPtr )(RakPeerInterface *, void *)
void * userUpdateThreadData
SignaledEvent quitAndDataEvents
bool limitConnectionFrequencyFromTheSameIP
SimpleMutex packetAllocationPoolMutex
DataStructures::MemoryPool
< Packet
packetAllocationPool
SimpleMutex packetReturnMutex
DataStructures::Queue< Packet * > packetReturnQueue
SimpleMutex sendReceiptSerialMutex
uint32_t sendReceiptSerial

Friends

void ProcessPortUnreachable (const unsigned int binaryAddress, const unsigned short port, RakPeer *rakPeer)
bool ProcessOfflineNetworkPacket (const SystemAddress systemAddress, const char *data, const int length, RakPeer *rakPeer, RakNetSmartPtr< RakNetSocket > rakNetSocket, bool *isOfflineMessage, RakNetTimeUS timeRead)
void ProcessNetworkPacket (const SystemAddress systemAddress, const char *data, const int length, RakPeer *rakPeer, RakNetSmartPtr< RakNetSocket > rakNetSocket, RakNetTimeUS timeRead)
void ProcessNetworkPacket (const SystemAddress systemAddress, const char *data, const int length, RakPeer *rakPeer, RakNetTimeUS timeRead)

Detailed Description

Main interface for network communications.

It implements most of RakNet's functionality and is the primary interface for RakNet.

Inherits RakPeerInterface.

See the individual functions for what the class can do.

Definition at line 46 of file RakPeer.h.


Member Enumeration Documentation

anonymous enum [protected]
Enumerator:
requestedConnectionList_Mutex 
offlinePingResponse_Mutex 
NUMBER_OF_RAKPEER_MUTEXES 

Definition at line 900 of file RakPeer.h.


Constructor & Destructor Documentation

RakPeer::RakPeer (  ) 

Constructor.

Definition at line 220 of file RakPeer.cpp.

Here is the call graph for this function:

RakPeer::~RakPeer (  )  [virtual]

Destructor.

Definition at line 302 of file RakPeer.cpp.

Here is the call graph for this function:


Member Function Documentation

void RakPeer::AddPacketToProducer ( Packet p  )  [inline, protected]

Definition at line 5398 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RakPeer::AddToBanList ( const char *  IP,
RakNetTime  milliseconds = 0 
) [virtual]

Bans an IP from connecting.

Banned IPs persist between connections but are not saved on shutdown nor loaded on startup.

Parameters:
[in] IP Dotted IP address. You can use * for a wildcard address, such as 128.0.0. * will ban all IP addresses starting with 128.0.0.
[in] milliseconds Gives time in milli seconds for a temporary ban of the IP address. Use 0 for a permanent ban.

Implements RakPeerInterface.

Definition at line 2161 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RakPeer::AddToSecurityExceptionList ( const char *  ip  )  [virtual]

This is useful if you have a fixed-address internal server behind a LAN.

Secure connections are determined by the recipient of an incoming connection. This has no effect if called on the system attempting to connect.

Note:
If secure connections are on, do not use secure connections for a specific IP address.
Parameters:
[in] ip IP address to add. * wildcards are supported.

Implements RakPeerInterface.

Definition at line 711 of file RakPeer.cpp.

Here is the call graph for this function:

bool RakPeer::AdvertiseSystem ( const char *  host,
unsigned short  remotePort,
const char *  data,
int  dataLength,
unsigned  connectionSocketIndex = 0 
) [virtual]

Sends a one byte message ID_ADVERTISE_SYSTEM to the remote unconnected system. This will send our external IP outside the LAN along with some user data to the remote system.

Precondition:
The sender and recipient must already be started via a successful call to Initialize
Parameters:
[in] host Either a dotted IP address or a domain name
[in] remotePort Which port to connect to on the remote machine.
[in] data Optional data to append to the packet.
[in] dataLength Length of data in bytes. Use 0 if no data.
[in] connectionSocketIndex Index into the array of socket descriptors passed to socketDescriptors in RakPeer::Startup() to send on.
Returns:
False if IsActive()==false or the host is unresolvable. True otherwise.

Implements RakPeerInterface.

Definition at line 2902 of file RakPeer.cpp.

Here is the call graph for this function:

Packet * RakPeer::AllocatePacket ( unsigned  dataSize  )  [virtual]

Returns a packet for you to write to if you want to create a Packet for some reason. You can add it to the receive buffer with PushBackPacket.

Parameters:
[in] dataSize How many bytes to allocate for the buffer
Returns:
A packet.

Implements RakPeerInterface.

Definition at line 3199 of file RakPeer.cpp.

Here is the call graph for this function:

Packet * RakPeer::AllocPacket ( unsigned  dataSize,
const char *  file,
unsigned int  line 
) [protected]

Definition at line 176 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Packet * RakPeer::AllocPacket ( unsigned  dataSize,
unsigned char *  data,
const char *  file,
unsigned int  line 
) [protected]

Definition at line 201 of file RakPeer.cpp.

Here is the call graph for this function:

void RakPeer::AllowConnectionResponseIPMigration ( bool  allow  )  [virtual]

Allow or disallow connection responses from any IP.

Normally this should be false, but may be necessary when connecting to servers with multiple IP addresses.

Parameters:
[in] allow - True to allow this behavior, false to not allow. Defaults to false. Value persists between connections.

Implements RakPeerInterface.

Definition at line 2886 of file RakPeer.cpp.

bool RakPeer::AllowIncomingConnections ( void   )  const [protected]

Definition at line 4956 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RakPeer::ApplyNetworkSimulator ( float  packetloss,
unsigned short  minExtraPing,
unsigned short  extraPingVariance 
) [virtual]

Adds simulated ping and packet loss to the outgoing data flow.

To simulate bi-directional ping and packet loss, you should call this on both the sender and the recipient, with half the total ping and maxSendBPS values on each.

Deprecated:
Use http://www.jenkinssoftware.com/raknet/forum/index.php?topic=1671.0 instead.
Note:
You can exclude network simulator code with the define _RELEASE to decrease code size.
Doesn't work past version 3.6201
Parameters:
[in] packetloss Chance to lose a packet. Ranges from 0 to 1.
[in] minExtraPing The minimum time to delay sends.
[in] extraPingVariance The additional random time to delay sends.

Implements RakPeerInterface.

Definition at line 3318 of file RakPeer.cpp.

RakPeer::RemoteSystemStruct * RakPeer::AssignSystemAddressToRemoteSystemList ( const SystemAddress  systemAddress,
RemoteSystemStruct::ConnectMode  connectionMode,
RakNetSmartPtr< RakNetSocket incomingRakNetSocket,
bool *  thisIPConnectedRecently,
SystemAddress  bindingAddress,
int  incomingMTU,
RakNetGUID  guid 
) [protected]

Get a free remote system from the list and assign our systemAddress to it.

Note:
Should only be called from the update thread - not the user thread.
Parameters:
[in] systemAddress systemAddress to be assigned
[in] connectionMode connection mode of the RemoteSystem.
[in] rakNetSocket 
[in] thisIPConnectedRecently Is this IP connected recently? set to False;
[in] bindingAddress Address to be binded with the remote system
[in] incomingMTU MTU for the remote system

Definition at line 3941 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RakPeer::AttachPlugin ( PluginInterface2 plugin  )  [virtual]

Attatches a Plugin interface to an instance of the base class (RakPeer or PacketizedTCP) to run code automatically on message receipt in the Receive call.

Note:
If plugins have dependencies on each other then the order does matter - for example the router plugin should go first because it might route messages for other plugins.
Parameters:
[in] messageHandler Pointer to the plugin to attach.

Implements RakPeerInterface.

Definition at line 3112 of file RakPeer.cpp.

Here is the call graph for this function:

void RakPeer::CancelConnectionAttempt ( const SystemAddress  target  )  [virtual]

Cancel a pending connection attempt.

If we are already connected, the connection stays open

Parameters:
[in] target Target system to cancel.

Implements RakPeerInterface.

Definition at line 1970 of file RakPeer.cpp.

Here is the call graph for this function:

void RakPeer::ChangeSystemAddress ( RakNetGUID  guid,
SystemAddress  systemAddress 
) [virtual]

Implements RakPeerInterface.

Definition at line 3179 of file RakPeer.cpp.

Here is the call graph for this function:

void RakPeer::ClearBanList ( void   )  [virtual]

Allows all previously banned IPs to connect.

Implements RakPeerInterface.

Definition at line 2248 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RakPeer::ClearBufferedCommands ( void   )  [protected]

Definition at line 5338 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RakPeer::ClearBufferedPackets ( void   )  [protected]

Definition at line 5363 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RakPeer::ClearRemoteSystemLookup ( void   )  [protected]

Definition at line 4309 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RakPeer::ClearRequestedConnectionList ( void   )  [protected]

Definition at line 5387 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RakPeer::ClearSocketQueryOutput ( void   )  [protected]

Definition at line 5382 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RakPeer::CloseConnection ( const SystemAddress  target,
bool  sendDisconnectionNotification,
unsigned char  orderingChannel = 0,
PacketPriority  disconnectionNotificationPriority = LOW_PRIORITY 
) [virtual]

Close the connection to another host (if we initiated the connection it will disconnect, if they did it will kick them out).

This method closes the connection irrespective of who initiated the connection.

Parameters:
[in] target Which system to close the connection to.
[in] sendDisconnectionNotification True to send ID_DISCONNECTION_NOTIFICATION to the recipient. False to close it silently.
[in] channel Which ordering channel to send the disconnection notification on, if any
[in] disconnectionNotificationPriority Priority to send ID_DISCONNECTION_NOTIFICATION on.

Implements RakPeerInterface.

Definition at line 1940 of file RakPeer.cpp.

Here is the call graph for this function:

void RakPeer::CloseConnectionInternal ( const AddressOrGUID systemIdentifier,
bool  sendDisconnectionNotification,
bool  performImmediate,
unsigned char  orderingChannel,
PacketPriority  disconnectionNotificationPriority 
) [protected]

Definition at line 4977 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool RakPeer::Connect ( const char *  host,
unsigned short  remotePort,
const char *  passwordData,
int  passwordDataLength,
unsigned  connectionSocketIndex = 0,
unsigned  sendConnectionAttemptCount = 12,
unsigned  timeBetweenSendConnectionAttemptsMS = 500,
RakNetTime  timeoutTime = 0 
) [virtual]

Connect to the specified host (ip or domain name) and server port.

Calling Connect and not calling SetMaximumIncomingConnections acts as a dedicated client. Calling both acts as a true peer.

This is a non-blocking connection.

The connection is successful when IsConnected() returns true or Receive() gets a message with the type identifier ID_CONNECTION_ACCEPTED. If the connection is not successful, such as a rejected connection or no response then neither of these things will happen.

Precondition:
Requires that you first call Initialize.
Parameters:
[in] host Either a dotted IP address or a domain name.
[in] remotePort Port to connect to on the remote machine.
[in] passwordData A data block that must match the data block on the server passed to SetIncomingPassword(). This can be a string or can be a stream of data. Use 0 for no password.
[in] passwordDataLength The length in bytes of passwordData.
[in] connectionSocketIndex Index into the array of socket descriptors passed to socketDescriptors in RakPeer::Startup() to determine the one to send on.
[in] sendConnectionAttemptCount Number of datagrams to send to the other system to try to connect.
[in] timeBetweenSendConnectionAttemptsMS Time to elapse before a datagram is sent to the other system to try to connect. After sendConnectionAttemptCount number of attempts, ID_CONNECTION_ATTEMPT_FAILED is returned.
[in] timeoutTime Time to elapse before dropping the connection if a reliable message could not be sent. 0 to use the default value from SetTimeoutTime(UNASSIGNED_SYSTEM_ADDRESS);
Returns:
True on successful initiation. False if you are already connected to this system, a connection to the system is pending, the domain name cannot be resolved, incorrect parameters, internal error, or too many existing peers.
Note:
Returning true does not mean you are connected! TODO - RakNet 4 - return enum

Implements RakPeerInterface.

Definition at line 865 of file RakPeer.cpp.

Here is the call graph for this function:

bool RakPeer::ConnectWithSocket ( const char *  host,
unsigned short  remotePort,
const char *  passwordData,
int  passwordDataLength,
RakNetSmartPtr< RakNetSocket socket,
unsigned  sendConnectionAttemptCount = 12,
unsigned  timeBetweenSendConnectionAttemptsMS = 500,
RakNetTime  timeoutTime = 0 
) [virtual]

Connect to the specified host (ip or domain name) and server port.

Parameters:
[in] host Either a dotted IP address or a domain name.
[in] remotePort Which port to connect to on the remote machine.
[in] passwordData A data block that must match the data block on the server passed to SetIncomingPassword(). This can be a string or can be a stream of data. Use 0 for no password.
[in] passwordDataLength The length in bytes of passwordData.
[in] socket A bound socket returned by another instance of RakPeerInterface.
[in] sendConnectionAttemptCount Number of datagrams to send to the other system to try to connect.
[in] timeBetweenSendConnectionAttemptsMS Time to elapse before a datagram is sent to the other system to try to connect. After sendConnectionAttemptCount number of attempts, ID_CONNECTION_ATTEMPT_FAILED is returned.
[in] timeoutTime Time to elapse before dropping the connection if a reliable message could not be sent. 0 to use the default from SetTimeoutTime(UNASSIGNED_SYSTEM_ADDRESS);
Returns:
True on successful initiation. False on incorrect parameters, internal error, or too many existing peers.
Note:
Returning true does not mean you arebconnected!

Implements RakPeerInterface.

Definition at line 903 of file RakPeer.cpp.

Here is the call graph for this function:

void RakPeer::DeallocatePacket ( Packet packet  )  [virtual]

Call this to deallocate a message returned by Receive() when you are done handling it.

Parameters:
[in] packet Message to deallocate.

Implements RakPeerInterface.

Definition at line 1489 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool RakPeer::DeleteCompressionLayer ( bool  inputLayer  )  [virtual]

Delete the output or input layer as specified.

This is not necessary to call and is only useful for freeing memory.

Precondition:
You should only call this when disconnected.
Parameters:
[in] inputLayer True to mean the inputLayer, false to mean the output layer.
Returns:
False (failure) if connected. Otherwise True (success).

Implements RakPeerInterface.

Definition at line 3051 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RakPeer::DerefAllSockets ( void   )  [protected]

Definition at line 6026 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RakPeer::DereferenceRemoteSystem ( SystemAddress  sa  )  [protected]

Definition at line 4263 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RakPeer::DetachPlugin ( PluginInterface2 messageHandler  )  [virtual]

Detaches a Plugin interface from the instance of the base class (RakPeer or PacketizedTCP) it is attached to.

This method disables the plugin code from running automatically on base class's updates or message receipt.

Parameters:
[in] messageHandler Pointer to a plugin to detach.

Implements RakPeerInterface.

Definition at line 3127 of file RakPeer.cpp.

Here is the call graph for this function:

void RakPeer::DisableSecurity ( void   )  [virtual]

Disables all security.

Note:
Must be called while offline.

Implements RakPeerInterface.

Definition at line 700 of file RakPeer.cpp.

bool RakPeer::GenerateCompressionLayer ( unsigned int  inputFrequencyTable[256],
bool  inputLayer 
) [virtual]

This is an optional function to generate the compression layer based on the input frequency table.

If you want to use it you should call this twice - once with inputLayer as true and once as false. The frequency table passed here with inputLayer=true should match the frequency table on the recipient with inputLayer=false. Likewise, the frequency table passed here with inputLayer=false should match the frequency table on the recipient with inputLayer=true. Calling this function when there is an existing layer will overwrite the old layer.

Precondition:
You should only call this when disconnected.
Parameters:
[in] inputFrequencyTable A frequency table for your data returned from GetOutgoingFrequencyTable()
[in] inputLayer Whether inputFrequencyTable represents incoming data from other systems (true) or outgoing data from this system (false).
Returns:
false (failure) if connected. Otherwise true (success)
See also:
Compression.cpp

Implements RakPeerInterface.

Definition at line 3018 of file RakPeer.cpp.

Here is the call graph for this function:

void RakPeer::GenerateGUID ( void   )  [protected]

Definition at line 5405 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned int RakPeer::GenerateSeedFromGuid ( void   )  [protected]

Definition at line 6005 of file RakPeer.cpp.

Here is the caller graph for this function:

void RakPeer::GenerateSYNCookieRandomNumber ( void   )  [protected]

Definition at line 4705 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int RakPeer::GetAveragePing ( const AddressOrGUID  systemIdentifier  )  [virtual]

Returns the average of all ping times read for the specific system or -1 if none read yet.

Parameters:
[in] systemAddress Which system we are referring to
Returns:
The ping time for this system, or -1

Implements RakPeerInterface.

Definition at line 2439 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

RakNetTime RakPeer::GetBestClockDifferential ( const SystemAddress  systemAddress  )  const [protected]

Get the most accurate clock differential for a certain player.

Parameters:
[in] systemAddress The player with whose clock the time difference is calculated.
Returns:
The clock differential for a certain player.

Definition at line 4147 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

float RakPeer::GetCompressionRatio ( void   )  const [virtual]

Returns the compression ratio.

A low compression ratio is good. Compression is defined for outgoing data.

Returns:
The compression ratio

Implements RakPeerInterface.

Definition at line 3081 of file RakPeer.cpp.

bool RakPeer::GetConnectionList ( SystemAddress remoteSystems,
unsigned short *  numberOfSystems 
) const [virtual]

Fills the array remoteSystems with the SystemAddress of all the systems we are connected to.

Parameters:
[out] remoteSystems An array of SystemAddress structures, to be filled with the SystemAddresss of the systems we are connected to. Pass 0 to remoteSystems to get the number of systems we are connected to.
[in,out] numberOfSystems As input, the size of remoteSystems array. As output, the number of elements put into the array.

Implements RakPeerInterface.

Definition at line 1091 of file RakPeer.cpp.

float RakPeer::GetDecompressionRatio ( void   )  const [virtual]

Returns the decompression ratio.

A high decompression ratio is good. Decompression ratio is defined for incoming data.

Returns:
The decompression ratio

Implements RakPeerInterface.

Definition at line 3096 of file RakPeer.cpp.

SystemAddress RakPeer::GetExternalID ( const SystemAddress  target  )  const [virtual]

Returns the unique address identifier that represents the target on the the network and is based on the target's external IP / port.

Parameters:
[in] target The SystemAddress of the remote system. Usually the same for all systems, unless you have two or more network cards.

Implements RakPeerInterface.

Definition at line 2591 of file RakPeer.cpp.

Here is the call graph for this function:

RakNetGUID RakPeer::GetGUIDFromIndex ( int  index  )  [virtual]

Same as GetSystemAddressFromIndex but returns RakNetGUID.

Parameters:
[in] index Index should range between 0 and the maximum number of players allowed - 1.
Returns:
The RakNetGUID

Implements RakPeerInterface.

Definition at line 2119 of file RakPeer.cpp.

const RakNetGUID & RakPeer::GetGuidFromSystemAddress ( const SystemAddress  input  )  const [virtual]

Given a connected system address, this method gives the unique GUID representing that instance of RakPeer. This will be the same on all systems connected to that instance of RakPeer, even if the external system addresses are different. Complexity is O(log2(n)). If input is UNASSIGNED_SYSTEM_ADDRESS, will return your own GUID.

Precondition:
Call Startup() first, or the function will return UNASSIGNED_RAKNET_GUID
Parameters:
[in] input The system address of the target system we are connected to.

Implements RakPeerInterface.

Definition at line 2618 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RakPeer::GetIncomingPassword ( char *  passwordData,
int *  passwordDataLength 
) [virtual]

Gets the password passed to SetIncomingPassword.

Parameters:
[out] passwordData Should point to a block large enough to hold the password data you passed to SetIncomingPassword()
[in,out] passwordDataLength Maximum size of the passwordData array. Modified to hold the number of bytes actually written.

Implements RakPeerInterface.

Definition at line 832 of file RakPeer.cpp.

int RakPeer::GetIndexFromGuid ( const RakNetGUID  guid  )  [protected]

Definition at line 3607 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int RakPeer::GetIndexFromSystemAddress ( const SystemAddress  systemAddress  )  const [virtual]

Given systemAddress, returns its index into remoteSystemList.

Values range from 0 to the maximum number of players allowed - 1. This includes systems which were formerly connected, but are now not connected.

Parameters:
[in] systemAddress The SystemAddress we are referring to
Returns:
The index of this SystemAddress or -1 on system not found.

Implements RakPeerInterface.

Definition at line 2088 of file RakPeer.cpp.

Here is the caller graph for this function:

int RakPeer::GetIndexFromSystemAddress ( const SystemAddress  systemAddress,
bool  calledFromNetworkThread 
) const [protected]

Definition at line 3577 of file RakPeer.cpp.

Here is the call graph for this function:

SystemAddress RakPeer::GetInternalID ( const SystemAddress  systemAddress = UNASSIGNED_SYSTEM_ADDRESS,
const int  index = 0 
) const [virtual]

Returns the unique address identifier that represents you or another system on the the network and is based on your local IP / port.

Parameters:
[in] systemAddress Use UNASSIGNED_SYSTEM_ADDRESS to get your behind-LAN address. Use a connected system to get their behind-LAN address
[in] index When you have multiple internal IDs, which index to return? Currently limited to MAXIMUM_NUMBER_OF_INTERNAL_IDS (so the maximum value of this variable is MAXIMUM_NUMBER_OF_INTERNAL_IDS-1)
Returns:
Identifier of your system internally, which may not be how other systems see if you if you are behind a NAT or proxy

Implements RakPeerInterface.

Definition at line 2552 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int RakPeer::GetLastPing ( const AddressOrGUID  systemIdentifier  )  const [virtual]

Returns the last ping time read for the specific system or -1 if none read yet.

Parameters:
[in] systemAddress Which system we are referring to
Returns:
The last ping time for this system, or -1.

Implements RakPeerInterface.

Definition at line 2468 of file RakPeer.cpp.

Here is the call graph for this function:

const char * RakPeer::GetLocalIP ( unsigned int  index  )  [virtual]

Returns an IP address at index 0 to GetNumberOfAddresses-1 in ipList array.

Parameters:
[in] index index into the list of IP addresses
Returns:
The local IP address at this index

Implements RakPeerInterface.

Definition at line 2831 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

SystemAddress RakPeer::GetLoopbackAddress ( void   )  const [protected]

Definition at line 4696 of file RakPeer.cpp.

Here is the caller graph for this function:

int RakPeer::GetLowestPing ( const AddressOrGUID  systemIdentifier  )  const [virtual]

Returns the lowest ping time read or -1 if none read yet.

Parameters:
[in] systemAddress Which system we are referring to
Returns:
The lowest ping time for this system, or -1.

Implements RakPeerInterface.

Definition at line 2490 of file RakPeer.cpp.

Here is the call graph for this function:

unsigned short RakPeer::GetMaximumIncomingConnections ( void   )  const [virtual]

Returns the value passed to SetMaximumIncomingConnections().

Returns:
Maximum number of incoming connections, which is always <= maxConnections

Implements RakPeerInterface.

Definition at line 785 of file RakPeer.cpp.

Here is the caller graph for this function:

unsigned short RakPeer::GetMaximumNumberOfPeers ( void   )  const [virtual]

Return the total number of connections we are allowed.

Returns:
Total number of connections allowed.

Implements RakPeerInterface.

Definition at line 1512 of file RakPeer.cpp.

int RakPeer::GetMTUSize ( const SystemAddress  target  )  const [virtual]

Returns the current MTU size.

Parameters:
[in] target Which system to get MTU for. UNASSIGNED_SYSTEM_ADDRESS to get the default
Returns:
The current MTU size of the target system.

Implements RakPeerInterface.

Definition at line 2797 of file RakPeer.cpp.

Here is the call graph for this function:

NetworkIDManager * RakPeer::GetNetworkIDManager ( void   )  const [virtual]
Returns:
Returns the value passed to SetNetworkIDManager or 0 if never called.

Implements RakPeerInterface.

Definition at line 1621 of file RakPeer.cpp.

uint32_t RakPeer::GetNextSendReceipt ( void   )  [virtual]

Returns the next uint32_t that Send() will return

Note:
If using RakPeer from multiple threads, this may not be accurate for your thread. Use IncrementNextSendReceipt() in that case.
Returns:
The next uint32_t that Send() or SendList will return

Implements RakPeerInterface.

Definition at line 1131 of file RakPeer.cpp.

Here is the call graph for this function:

unsigned int RakPeer::GetNumberOfAddresses ( void   )  [virtual]

Returns the number of IP addresses this system has internally.

Get the actual addresses from GetLocalIP()

Implements RakPeerInterface.

Definition at line 2811 of file RakPeer.cpp.

Here is the caller graph for this function:

unsigned short RakPeer::GetNumberOfRemoteInitiatedConnections ( void   )  const [protected]

Returns how many remote systems initiated a connection to us.

Definition at line 3920 of file RakPeer.cpp.

Here is the caller graph for this function:

void RakPeer::GetOfflinePingResponse ( char **  data,
unsigned int *  length 
) [virtual]

Returns pointers to a copy of the data passed to SetOfflinePingResponse.

Parameters:
[out] data A pointer to a copy of the data passed to SetOfflinePingResponse()
[out] length A pointer filled in with the length parameter passed to SetOfflinePingResponse()
See also:
SetOfflinePingResponse

Implements RakPeerInterface.

Definition at line 2539 of file RakPeer.cpp.

Here is the call graph for this function:

bool RakPeer::GetOutgoingFrequencyTable ( unsigned int  outputFrequencyTable[256]  )  [virtual]

Returns the frequency of outgoing bytes into outputFrequencyTable The purpose is to save to file as either a master frequency table from a sample game session for passing to GenerateCompressionLayer().

Precondition:
You should only call this when disconnected. Requires that you first enable data frequency tracking by calling SetCompileFrequencyTable(true)
Parameters:
[out] outputFrequencyTable The frequency of each corresponding byte
Returns:
False (failure) if connected or if frequency table tracking is not enabled. Otherwise true (success)

Implements RakPeerInterface.

Definition at line 2989 of file RakPeer.cpp.

Here is the call graph for this function:

unsigned int RakPeer::GetRakNetSocketFromUserConnectionSocketIndex ( unsigned int  userIndex  )  const [protected]

Definition at line 6036 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned int RakPeer::GetReceiveBufferSize ( void   )  [virtual]

how many messages are waiting when you call Receive()

Implements RakPeerInterface.

Definition at line 3568 of file RakPeer.cpp.

Here is the call graph for this function:

RakPeer::RemoteSystemStruct * RakPeer::GetRemoteSystem ( const AddressOrGUID  systemIdentifier,
bool  calledFromNetworkThread,
bool  onlyActive 
) const [protected]

Definition at line 3725 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

RakPeer::RemoteSystemStruct * RakPeer::GetRemoteSystem ( SystemAddress  sa  )  const [protected]

Definition at line 4301 of file RakPeer.cpp.

Here is the call graph for this function:

RakPeer::RemoteSystemStruct * RakPeer::GetRemoteSystemFromGUID ( const RakNetGUID  guid,
bool  onlyActive 
) const [protected]

Definition at line 3775 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

RakPeer::RemoteSystemStruct * RakPeer::GetRemoteSystemFromSystemAddress ( const SystemAddress  systemAddress,
bool  calledFromNetworkThread,
bool  onlyActive 
) const [protected]

Get the reliability layer associated with a systemAddress.

Parameters:
[in] systemAddress The player identifier
Returns:
0 if none

Definition at line 3733 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned int RakPeer::GetRemoteSystemIndex ( SystemAddress  sa  )  const [protected]

Definition at line 4288 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

char * RakPeer::GetRPCString ( const char *  data,
const BitSize_t  bitSize,
const SystemAddress  systemAddress 
) [virtual]

Implements RakPeerInterface.

Definition at line 3406 of file RakPeer.cpp.

Here is the call graph for this function:

RakNetSmartPtr< RakNetSocket > RakPeer::GetSocket ( const SystemAddress  target  )  [virtual]

Get the socket used with a particular active connection. The smart pointer reference counts the RakNetSocket object, so the socket will remain active as long as the smart pointer does, even if RakNet were to shutdown or close the connection.

Note:
This sends a query to the thread and blocks on the return value for up to one second. In practice it should only take a millisecond or so.
Parameters:
[in] target Which system.
Returns:
A smart pointer object containing the socket information about the target. Be sure to check IsNull() which is returned if the update thread is unresponsive, shutting down, or if this system is not connected.

Implements RakPeerInterface.

Definition at line 3204 of file RakPeer.cpp.

Here is the call graph for this function:

void RakPeer::GetSockets ( DataStructures::List< RakNetSmartPtr< RakNetSocket > > &  sockets  )  [virtual]

Gets all sockets in use.

Note:
This sends a query to the thread and blocks on the return value for up to one second. In practice it should only take a millisecond or so.
Parameters:
[out] sockets List of RakNetSocket structures in use. Sockets will not be closed until sockets goes out of scope

Implements RakPeerInterface.

Definition at line 3260 of file RakPeer.cpp.

Here is the call graph for this function:

int RakPeer::GetSplitMessageProgressInterval ( void   )  const [virtual]

Returns what was passed to SetSplitMessageProgressInterval().

Returns:
Number of messages to be recieved before a download progress notification is returned. Default to 0.

Implements RakPeerInterface.

Definition at line 2927 of file RakPeer.cpp.

bool RakPeer::GetStatistics ( const int  index,
RakNetStatistics rns 
) [virtual]

Returns the network statistics of the system at the given index in the remoteSystemList.

Returns:
True if the index is less than the maximum number of peers allowed and the system is active. False otherwise.

Implements RakPeerInterface.

Definition at line 3558 of file RakPeer.cpp.

Here is the call graph for this function:

RakNetStatistics *const RakPeer::GetStatistics ( const SystemAddress  systemAddress,
RakNetStatistics rns = 0 
) [virtual]

Returns a structure containing a large set of network statistics for the specified system. You can map this data to a string using the C style StatisticsToString() function.

Parameters:
[in] systemAddress Which connected system to get statistics for.
[in] rns If you supply this structure,the network statistics will be written to it. Otherwise the method uses a static struct to write the data, which is not threadsafe.
Returns:
0 if the specified system can't be found. Otherwise a pointer to the struct containing the specified system's network statistics.
See also:
RakNetStatistics.h

Implements RakPeerInterface.

Definition at line 3512 of file RakPeer.cpp.

Here is the call graph for this function:

SystemAddress RakPeer::GetSystemAddressFromGuid ( const RakNetGUID  input  )  const [virtual]

Gives the system address of a connected system, given its GUID. The GUID will be the same on all systems connected to that instance of RakPeer, even if the external system addresses are different. Currently O(log(n)), but this may be improved in the future If input is UNASSIGNED_RAKNET_GUID, UNASSIGNED_SYSTEM_ADDRESS is returned.

Parameters:
[in] input The RakNetGUID of the target system.

Implements RakPeerInterface.

Definition at line 2665 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

SystemAddress RakPeer::GetSystemAddressFromIndex ( int  index  )  [virtual]

Given index into remoteSystemList, will return a SystemAddress. This function is only useful for looping through all systems.

Parameters:
[in] index Index should range between 0 and the maximum number of players allowed - 1.
Returns:
The SystemAddress structure corresponding to index in remoteSystemList.

Implements RakPeerInterface.

Definition at line 2103 of file RakPeer.cpp.

unsigned int RakPeer::GetSystemIndexFromGuid ( const RakNetGUID  input  )  const [protected]

Definition at line 2640 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RakPeer::GetSystemList ( DataStructures::List< SystemAddress > &  addresses,
DataStructures::List< RakNetGUID > &  guids 
) [virtual]

Same as calling GetSystemAddressFromIndex and GetGUIDFromIndex for all systems, but more efficient Indices match each other, so addresses[0] and guids[0] refer to the same system.

Parameters:
[out] addresses All system addresses. Size of the list is the number of connections. Size of the addresses list will match the size of the guids list.
[out] guids All guids. Size of the list is the number of connections. Size of the list will match the size of the addresses list.

Implements RakPeerInterface.

Definition at line 2136 of file RakPeer.cpp.

Here is the call graph for this function:

RakNetTime RakPeer::GetTimeoutTime ( const SystemAddress  target  )  [virtual]

Returns the Timeout time for the given system.

Parameters:
[in] target Target system to get the TimeoutTime for. Pass UNASSIGNED_SYSTEM_ADDRESS to get the default value.
Returns:
Timeout time for a given system.

Implements RakPeerInterface.

Definition at line 2719 of file RakPeer.cpp.

Here is the call graph for this function:

bool RakPeer::HandleRPCPacket ( const char *  data,
int  length,
SystemAddress  systemAddress 
) [protected]

Handles an RPC packet. This packet has an RPC request.

Parameters:
[in] data A packet returned from Receive with the ID ID_RPC
[in] length The size of the packet data
[in] systemAddress The sender of the packet
Returns:
True on success, false on a bad packet or an unregistered function

Definition at line 4373 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RakPeer::HandleRPCReplyPacket ( const char *  data,
int  length,
SystemAddress  systemAddress 
) [protected]

Handles an RPC reply packet. The reply packet has data returned from an RPC call.

Parameters:
[in] data A packet returned from Receive with the ID ID_RPC
[in] length The size of the packet data
[in] systemAddress The sender of the packet

Handles an RPC reply packet. This is data returned from an RPC call

Parameters:
data A packet returned from Receive with the ID ID_RPC
length The size of the packet data
systemAddress The sender of the packet
Returns:
true on success, false on a bad packet or an unregistered function

Definition at line 4636 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

uint32_t RakPeer::IncrementNextSendReceipt ( void   )  [virtual]

Returns the next uint32_t that Send() will return, and increments the value by one

Note:
If using RakPeer from multiple threads, pass this to forceReceipt in the send function
Returns:
The next uint32_t that Send() or SendList will return

Implements RakPeerInterface.

Definition at line 1139 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RakPeer::InitializeSecurity ( const char *  pubKeyE,
const char *  pubKeyN,
const char *  privKeyP,
const char *  privKeyQ 
) [virtual]

Secures connections though a combination of SHA1, AES128, SYN Cookies, and RSA to prevent connection spoofing, replay attacks, data eavesdropping, packet tampering, and MitM attacks.

If you accept connections, you must call this for the secure connection to be enabled for incoming connections. If you are connecting to another system, you can call this with public key values for p,q and e before connecting to prevent MitM. Define how many bits are used in RakNetDefines.h with RAKNET_RSA_FACTOR_LIMBS.

Note:
There is a significant amount of processing and a slight amount of bandwidth overhead for this feature.
Precondition:
Must be called before Initialize.
Parameters:
[in] pubKeyE A pointer to the public keys from the RSACrypt class.
[in] pubKeyN A pointer to the public keys from the RSACrypt class.
[in] privKeyP Public key generated from the RSACrypt class.
[in] privKeyQ Public key generated from the RSACrypt class. If the private keys are 0, then a new key will be generated when this function is called
See also:
the Encryption sample

Implements RakPeerInterface.

Definition at line 637 of file RakPeer.cpp.

Here is the call graph for this function:

bool RakPeer::IsActive ( void   )  const [inline, virtual]

Returns true if the network thread is running.

Returns:
True if the network thread is running, False otherwise

Implements RakPeerInterface.

Definition at line 1077 of file RakPeer.cpp.

Here is the caller graph for this function:

bool RakPeer::IsBanned ( const char *  IP  )  [virtual]

Returns true or false indicating if a particular IP is banned.

Parameters:
[in] IP Dotted IP address.
Returns:
True if IP matches any IPs in the ban list, accounting for any wildcards. False otherwise.

Implements RakPeerInterface.

Definition at line 2281 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool RakPeer::IsConnected ( const AddressOrGUID  systemIdentifier,
bool  includeInProgress = false,
bool  includeDisconnecting = false 
) [virtual]

Returns if a particular systemAddress is connected to us.

Note:
This can also be made to return true if we are in the process of connecting.
Parameters:
[in] systemAddress The SystemAddress we are referring to
[in] includeInProgress If true, also return true for connections that are in progress but haven't completed
[in] includeDisconnecting If true, also return true for connections that are in the process of disconnecting
Returns:
True if this system is connected and active, false otherwise.

Implements RakPeerInterface.

Definition at line 2021 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool RakPeer::IsConnectionAttemptPending ( const SystemAddress  systemAddress  )  [virtual]

Returns if a particular systemAddress has a pending or in progress connection attempt

Parameters:
[in] systemAddress The SystemAddress we are referring to

Implements RakPeerInterface.

Definition at line 1992 of file RakPeer.cpp.

Here is the call graph for this function:

bool RakPeer::IsInSecurityExceptionList ( const char *  ip  )  [virtual]

Checks to see if a given IP is in the security exception list.

Parameters:
[in] IP address to check.
Returns:
True if the IP address is found in security exception list, else returns false.

Implements RakPeerInterface.

Definition at line 748 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool RakPeer::IsLocalIP ( const char *  ip  )  [virtual]

Is this a local IP? Checks if this ip is in the ipList array.

Parameters:
[in] An IP address to check, excluding the port.
Returns:
True if this is one of the IP addresses returned by GetLocalIP

Implements RakPeerInterface.

Definition at line 2855 of file RakPeer.cpp.

Here is the call graph for this function:

bool RakPeer::IsLoopbackAddress ( const AddressOrGUID systemIdentifier,
bool  matchPort 
) const [protected]

Definition at line 4649 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool RakPeer::IsNetworkSimulatorActive ( void   )  [virtual]

Returns true if you previously called ApplyNetworkSimulator.

Returns:
Ture if you previously called ApplyNetworkSimulator. False otherwise.

Implements RakPeerInterface.

Definition at line 3345 of file RakPeer.cpp.

void RakPeer::NotifyAndFlagForShutdown ( const SystemAddress  systemAddress,
bool  performImmediate,
unsigned char  orderingChannel,
PacketPriority  disconnectionNotificationPriority 
) [protected]

Send a reliable disconnect packet to this player and disconnect them when it is delivered.

Definition at line 3904 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned short RakPeer::NumberOfConnections ( void   )  const [virtual]

Returns how many open connections exist at this time.

Returns:
Number of open connections.

Implements RakPeerInterface.

Definition at line 794 of file RakPeer.cpp.

void RakPeer::OnConnectedPong ( RakNetTime  sendPingTime,
RakNetTime  sendPongTime,
RemoteSystemStruct remoteSystem 
) [protected]

Definition at line 5306 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RakPeer::OnConnectionRequest ( RakPeer::RemoteSystemStruct remoteSystem,
unsigned char *  AESKey,
bool  setAESKey,
RakNetTime  incomingTimestamp 
) [protected]

When we get a connection request from an ip / port, accept it unless full.

Definition at line 3858 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RakPeer::ParseConnectionRequestPacket ( RakPeer::RemoteSystemStruct remoteSystem,
SystemAddress  systemAddress,
const char *  data,
int  byteSize 
) [protected]

Parse out a connection request packet.

AllowIncomingConnections() )

Definition at line 3791 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RakPeer::Ping ( const SystemAddress  target  )  [virtual]

Send a ping to the specified connected system.

Precondition:
The sender and recipient must already be started via a successful call to Startup()
Parameters:
[in] target Which system to ping

Implements RakPeerInterface.

Definition at line 2373 of file RakPeer.cpp.

Here is the call graph for this function:

bool RakPeer::Ping ( const char *  host,
unsigned short  remotePort,
bool  onlyReplyOnAcceptingConnections,
unsigned  connectionSocketIndex = 0 
) [virtual]

Send a ping to the specified unconnected system.

The remote system, if it is Initialized, will respond with ID_PONG followed by sizeof(RakNetTime) containing the system time the ping was sent. Default is 4 bytes - See __GET_TIME_64BIT in RakNetTypes.h System should reply with ID_PONG if it is active

Parameters:
[in] host Either a dotted IP address or a domain name. Can be 255.255.255.255 for LAN broadcast.
[in] remotePort Which port to connect to on the remote machine.
[in] onlyReplyOnAcceptingConnections Only request a reply if the remote system is accepting connections
[in] connectionSocketIndex Index into the array of socket descriptors passed to socketDescriptors in RakPeer::Startup() to send on.
Returns:
true on success, false on failure (unknown hostname)

Implements RakPeerInterface.

Definition at line 2390 of file RakPeer.cpp.

Here is the call graph for this function:

void RakPeer::PingInternal ( const SystemAddress  target,
bool  performImmediate,
PacketReliability  reliability 
) [protected]

Definition at line 4961 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RakPeer::PushBackPacket ( Packet packet,
bool  pushAtHead 
) [virtual]

Puts a message back in the receive queue in case you don't want to deal with it immediately.

Parameters:
[in] packet The pointer to the packet you want to push back.
[in] pushAtHead True to push the packet at the start of the queue so that the next receive call returns it. False to push it at the end of the queue.
Note:
Setting pushAtHead to false end makes the packets out of order.

Implements RakPeerInterface.

Definition at line 3150 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

RakPeer::RAK_THREAD_DECLARATION ( UpdateNetworkLoop   )  [protected]
RakPeer::RAK_THREAD_DECLARATION ( UDTConnect   )  [protected]
RakPeer::RAK_THREAD_DECLARATION ( RecvFromLoop   )  [protected]
Packet * RakPeer::Receive ( void   )  [virtual]

Gets a message from the incoming message queue.

Use DeallocatePacket() to deallocate the message after you are done with it. User-thread functions, such as RPC calls and the plugin function PluginInterface::Update occur here.

Returns:
0 if no packets are waiting to be handled, otherwise a pointer to a packet.
Note:
COMMON MISTAKE: Be sure to call this in a loop, once per game tick, until it returns 0. If you only process one packet per game tick they will buffer up.
See also:
RakNetTypes.h contains struct Packet.

Implements RakPeerInterface.

Definition at line 1349 of file RakPeer.cpp.

Here is the call graph for this function:

Packet * RakPeer::ReceiveIgnoreRPC ( void   )  [protected]

Definition at line 1371 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RakPeer::ReferenceRemoteSystem ( SystemAddress  sa,
unsigned int  remoteSystemListIndex 
) [protected]

Definition at line 4182 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned int RakPeer::RemoteSystemLookupHashIndex ( SystemAddress  sa  )  const [protected]

Definition at line 4175 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RakPeer::RemoveFromBanList ( const char *  IP  )  [virtual]

Allows a previously banned IP to connect. param[in] Dotted IP address. You can use * as a wildcard. An IP such as 128.0.0.* will ban all IP addresses starting with 128.0.0.

Implements RakPeerInterface.

Definition at line 2210 of file RakPeer.cpp.

Here is the call graph for this function:

void RakPeer::RemoveFromSecurityExceptionList ( const char *  ip  )  [virtual]

Remove a specific connection previously added via AddToSecurityExceptionList.

Parameters:
[in] ip IP address to remove. Pass 0 to remove all IP addresses. * wildcards are supported.

Implements RakPeerInterface.

Definition at line 719 of file RakPeer.cpp.

Here is the call graph for this function:

void RakPeer::RemoveRouterInterface ( RouterInterface routerInterface  )  [virtual]
Deprecated:
This was added without considering proper architecture

Implements RakPeerInterface.

Definition at line 3173 of file RakPeer.cpp.

void RakPeer::ResetSendReceipt ( void   )  [protected]

Definition at line 5299 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool RakPeer::RunUpdateCycle ( void   )  [protected]

Definition at line 6048 of file RakPeer.cpp.

Here is the caller graph for this function:

void RakPeer::SecuredConnectionConfirmation ( RakPeer::RemoteSystemStruct remoteSystem,
char *  data 
) [protected]

Definition at line 4786 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RakPeer::SecuredConnectionResponse ( const SystemAddress  systemAddress  )  [protected]

Definition at line 4723 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

uint32_t RakPeer::Send ( const char *  data,
const int  length,
PacketPriority  priority,
PacketReliability  reliability,
char  orderingChannel,
const AddressOrGUID  systemIdentifier,
bool  broadcast,
uint32_t  forceReceipt = 0 
) [virtual]

Sends a block of data to the specified system that you are connected to.

Note:
This function only works while the connected.
The first byte should be a message identifier starting at ID_USER_PACKET_ENUM.
Parameters:
[in] data Block of data to send.
[in] length Size in bytes of the data to send.
[in] priority Priority level to send on. See PacketPriority.h
[in] reliability How reliably to send this data. See PacketPriority.h
[in] orderingChannel When using ordered or sequenced messages, the channel to order these on. Messages are only ordered relative to other messages on the same stream.
[in] systemIdentifier Who to send this packet to, or in the case of broadcasting who not to send it to. Pass either a SystemAddress structure or a RakNetGUID structure. Use UNASSIGNED_SYSTEM_ADDRESS or to specify none
[in] broadcast True to send this packet to all connected systems. If true, then systemAddress specifies who not to send the packet to.
[in] forceReceipt If 0, will automatically determine the receipt number to return. If non-zero, will return what you give it.
Returns:
0 on bad input. Otherwise a number that identifies this message. If reliability is a type that returns a receipt, on a later call to Receive() you will get ID_SND_RECEIPT_ACKED or ID_SND_RECEIPT_LOSS with bytes 1-4 inclusive containing this number

Implements RakPeerInterface.

Definition at line 1168 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

uint32_t RakPeer::Send ( const RakNet::BitStream bitStream,
PacketPriority  priority,
PacketReliability  reliability,
char  orderingChannel,
const AddressOrGUID  systemIdentifier,
bool  broadcast,
uint32_t  forceReceipt = 0 
) [virtual]

Sends a block of data to the specified system that you are connected to.

Same as the above version, but takes a BitStream as input.

Parameters:
[in] bitStream Bitstream to send
[in] priority Priority level to send on. See PacketPriority.h
[in] reliability How reliably to send this data. See PacketPriority.h
[in] orderingChannel Channel to order the messages on, when using ordered or sequenced messages. Messages are only ordered relative to other messages on the same stream.
[in] systemIdentifier System Address or RakNetGUID to send this packet to, or in the case of broadcasting, the address not to send it to. Use UNASSIGNED_SYSTEM_ADDRESS to specify none.
[in] broadcast True to send this packet to all connected systems. If true, then systemAddress specifies who not to send the packet to.
[in] forceReceipt If 0, will automatically determine the receipt number to return. If non-zero, will return what you give it.
Returns:
0 on bad input. Otherwise a number that identifies this message. If reliability is a type that returns a receipt, on a later call to Receive() you will get ID_SND_RECEIPT_ACKED or ID_SND_RECEIPT_LOSS with bytes 1-4 inclusive containing this number
Note:
COMMON MISTAKE: When writing the first byte, bitStream->Write((unsigned char) ID_MY_TYPE) be sure it is casted to a byte, and you are not writing a 4 byte enumeration.

Implements RakPeerInterface.

Definition at line 1233 of file RakPeer.cpp.

Here is the call graph for this function:

void RakPeer::SendBuffered ( const char *  data,
BitSize_t  numberOfBitsToSend,
PacketPriority  priority,
PacketReliability  reliability,
char  orderingChannel,
const AddressOrGUID  systemIdentifier,
bool  broadcast,
RemoteSystemStruct::ConnectMode  connectionMode,
uint32_t  receipt 
) [protected]

Definition at line 5071 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RakPeer::SendBufferedList ( const char **  data,
const int *  lengths,
const int  numParameters,
PacketPriority  priority,
PacketReliability  reliability,
char  orderingChannel,
const AddressOrGUID  systemIdentifier,
bool  broadcast,
RemoteSystemStruct::ConnectMode  connectionMode,
uint32_t  receipt 
) [protected]

Definition at line 5114 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool RakPeer::SendConnectionRequest ( const char *  host,
unsigned short  remotePort,
const char *  passwordData,
int  passwordDataLength,
unsigned  connectionSocketIndex,
unsigned int  extraData,
unsigned  sendConnectionAttemptCount,
unsigned  timeBetweenSendConnectionAttemptsMS,
RakNetTime  timeoutTime 
) [protected]

Definition at line 3630 of file RakPeer.cpp.

Here is the call graph for this function:

bool RakPeer::SendConnectionRequest ( const char *  host,
unsigned short  remotePort,
const char *  passwordData,
int  passwordDataLength,
unsigned  connectionSocketIndex,
unsigned int  extraData,
unsigned  sendConnectionAttemptCount,
unsigned  timeBetweenSendConnectionAttemptsMS,
RakNetTime  timeoutTime,
RakNetSmartPtr< RakNetSocket socket 
) [protected]

Definition at line 3675 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RakPeer::SendConnectionRequestAccepted ( RakPeer::RemoteSystemStruct remoteSystem,
RakNetTime  incomingTimestamp 
) [protected]

Definition at line 3887 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool RakPeer::SendImmediate ( char *  data,
BitSize_t  numberOfBitsToSend,
PacketPriority  priority,
PacketReliability  reliability,
char  orderingChannel,
const AddressOrGUID  systemIdentifier,
bool  broadcast,
bool  useCallerDataAllocation,
RakNetTimeUS  currentTime,
uint32_t  receipt 
) [protected]

Definition at line 5179 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

uint32_t RakPeer::SendList ( const char **  data,
const int *  lengths,
const int  numParameters,
PacketPriority  priority,
PacketReliability  reliability,
char  orderingChannel,
const AddressOrGUID  systemIdentifier,
bool  broadcast,
uint32_t  forceReceipt = 0 
) [virtual]

Sends multiple blocks of data, concatenating them automatically.

This is equivalent to: RakNet::BitStream bs; bs.WriteAlignedBytes(block1, blockLength1); bs.WriteAlignedBytes(block2, blockLength2); bs.WriteAlignedBytes(block3, blockLength3); Send(&bs, ...)

This function only works when connected.

Parameters:
[in] data An array of pointers to blocks of data
[in] lengths An array of integers indicating the length of each block of data
[in] numParameters Length of the arrays data and lengths
[in] priority Priority level to send on. See PacketPriority.h
[in] reliability How reliably to send this data. See PacketPriority.h
[in] orderingChannel Channel to order the messages on, when using ordered or sequenced messages. Messages are only ordered relative to other messages on the same stream.
[in] systemIdentifier System Address or RakNetGUID to send this packet to, or in the case of broadcasting, the address not to send it to. Use UNASSIGNED_SYSTEM_ADDRESS to specify none.
[in] broadcast True to send this packet to all connected systems. If true, then systemAddress specifies who not to send the packet to.
[in] forceReceipt If 0, will automatically determine the receipt number to return. If non-zero, will return what you give it.
Returns:
0 on bad input. Otherwise a number that identifies this message. If reliability is a type that returns a receipt, on a later call to Receive() you will get ID_SND_RECEIPT_ACKED or ID_SND_RECEIPT_LOSS with bytes 1-4 inclusive containing this number
Note:
Doesn't support the router plugin.

Implements RakPeerInterface.

Definition at line 1307 of file RakPeer.cpp.

Here is the call graph for this function:

void RakPeer::SendLoopback ( const char *  data,
const int  length 
) [virtual]

"Send" to yourself rather than a remote system.

The message will be processed through the plugins and returned to the game as usual. This function works anytime

Note:
The first byte should be a message identifier starting at ID_USER_PACKET_ENUM
Parameters:
[in] data Block of data to send.
[in] length Size in bytes of the data to send.

Implements RakPeerInterface.

Definition at line 1221 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool RakPeer::SendOutOfBand ( const char *  host,
unsigned short  remotePort,
const char *  data,
BitSize_t  dataLength,
unsigned  connectionSocketIndex = 0 
) [virtual]

Implements RakPeerInterface.

Definition at line 3465 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RakPeer::SendTTL ( const char *  host,
unsigned short  remotePort,
int  ttl,
unsigned  connectionSocketIndex = 0 
) [virtual]

Send a message to a host, with the IP socket option TTL set to 3.

This message will not reach the host, but will open the router.

Parameters:
[in] host The address of the remote host in dotted notation.
[in] remotePort The port number to send to.
[in] ttl Max hops of datagram, set to 3
[in] connectionSocketIndex userConnectionSocketIndex.
Remarks:
Used for NAT-Punchthrough

Implements RakPeerInterface.

Definition at line 2950 of file RakPeer.cpp.

Here is the call graph for this function:

void RakPeer::SetCompileFrequencyTable ( bool  doCompile  )  [virtual]

Enables or disables frequency table tracking.

This is required to get a frequency table, which is used in GenerateCompressionLayer(). This value persists between connect calls and defaults to false (no frequency tracking).

Precondition:
You can call this at any time - however you SHOULD only call it when disconnected. Otherwise you will only trackpart of the values sent over the network.
Parameters:
[in] doCompile True to enable tracking

Implements RakPeerInterface.

Definition at line 2970 of file RakPeer.cpp.

void RakPeer::SetIncomingPassword ( const char *  passwordData,
int  passwordDataLength 
) [virtual]

Sets the password for the incoming connections.

The password must match in the call to Connect (defaults to none). Pass 0 to passwordData to specify no password. This is a way to set a low level password for all incoming connections. To selectively reject connections, implement your own scheme using CloseConnection() to remove unwanted connections.

Parameters:
[in] passwordData A data block that incoming connections must match. This can be just a password, or can be a stream of data. Specify 0 for no password data
[in] passwordDataLength The length in bytes of passwordData

Implements RakPeerInterface.

Definition at line 813 of file RakPeer.cpp.

void RakPeer::SetLimitIPConnectionFrequency ( bool  b  )  [virtual]

Enable or disable allowing frequent connections from the same IP adderss.

This is a security measure which is disabled by default, but can be set to true to prevent attackers from using up all connection slots.

Parameters:
[in] b True to limit connections from the same ip to at most 1 per 100 milliseconds.

Implements RakPeerInterface.

Definition at line 2265 of file RakPeer.cpp.

void RakPeer::SetMaximumIncomingConnections ( unsigned short  numberAllowed  )  [virtual]

Sets the maximum number of incoming connections allowed.

If the number of incoming connections is less than the number of players currently connected, no more players will be allowed to connect. If this is greater than the maximum number of peers allowed, it will be reduced to the maximum number of peers allowed.

Defaults to 0, meaning by default, nobody can connect to you

Parameters:
[in] numberAllowed Maximum number of incoming connections allowed.

Implements RakPeerInterface.

Definition at line 776 of file RakPeer.cpp.

void RakPeer::SetOccasionalPing ( bool  doPing  )  [virtual]

Ping the remote systems every so often, or not. Can be called anytime. By default this is true if GET_TIME_SPIKE_LIMIT is non-zero from RakNetDefines, false otherwise It would be true by default to prevent timestamp drift, since in the event of a clock spike, the timestamp deltas would no longer be accurate

Parameters:
[in] doPing True to start occasional pings. False to stop them.

Implements RakPeerInterface.

Definition at line 2508 of file RakPeer.cpp.

void RakPeer::SetOfflinePingResponse ( const char *  data,
const unsigned int  length 
) [virtual]

Sets the data to send along with a LAN server discovery or offline ping reply.

Parameters:
[in] data Block of data to send, or 0 for none
[in] length Length of the data in bytes, or 0 for none
Note:
length should be under 400 bytes, as a security measure against flood attacks
See also:
Ping.cpp

Implements RakPeerInterface.

Definition at line 2520 of file RakPeer.cpp.

Here is the call graph for this function:

void RakPeer::SetPerConnectionOutgoingBandwidthLimit ( unsigned  maxBitsPerSecond  )  [virtual]

Limits how much outgoing bandwidth can be used per-connection. This limit does not apply to the sum of all connections! Exceeding the limit queues up outgoing traffic.

Parameters:
[in] maxBitsPerSecond Maximum bits per second to send. Use 0 for unlimited (default). Once set, it takes effect immedately and persists until called again.

Implements RakPeerInterface.

Definition at line 3337 of file RakPeer.cpp.

void RakPeer::SetRouterInterface ( RouterInterface routerInterface  )  [virtual]

------------------------------------------- Deprecated -------------------------

------------------------------------------- Deprecated -------------------------

Deprecated:
This was added without considering proper architecture

Implements RakPeerInterface.

Definition at line 3168 of file RakPeer.cpp.

void RakPeer::SetSplitMessageProgressInterval ( int  interval  )  [virtual]

Controls how often to return ID_DOWNLOAD_PROGRESS for large message downloads.

ID_DOWNLOAD_PROGRESS is returned to indicate a new partial message chunk, roughly the MTU size, has arrived. As it can be slow or cumbersome to get this notification for every chunk, you can set the interval at which it is returned. Defaults to 0 (never return this notification).

Parameters:
[in] interval How many messages to use as an interval before a download progress notification is returned.

Implements RakPeerInterface.

Definition at line 2916 of file RakPeer.cpp.

void RakPeer::SetTimeoutTime ( RakNetTime  timeMS,
const SystemAddress  target 
) [virtual]

Set the time, in MS, to use before considering ourselves disconnected after not being able to deliver a reliable message.

Default time is 10,000 or 10 seconds in release and 30,000 or 30 seconds in debug.

Parameters:
[in] timeMS Time, in MS
[in] target SystemAddress structure of the target system. Pass UNASSIGNED_SYSTEM_ADDRESS for all systems.

Implements RakPeerInterface.

Definition at line 2692 of file RakPeer.cpp.

Here is the call graph for this function:

void RakPeer::SetUnreliableTimeout ( RakNetTime  timeoutMS  )  [virtual]

Set how long to wait before giving up on sending an unreliable message. Useful if the network is clogged up. Set to 0 or less to never timeout. Defaults to 0.

Parameters:
[in] timeoutMS How many ms to wait before simply not sending an unreliable message.

Implements RakPeerInterface.

Definition at line 2938 of file RakPeer.cpp.

void RakPeer::SetUserUpdateThread ( void(*)(RakPeerInterface *, void *)  _userUpdateThreadPtr,
void *  _userUpdateThreadData 
) [virtual]

If you need code to run in the same thread as RakNet's update thread, this function can be used for that

Parameters:
[in] _userUpdateThreadPtr C callback function
[in] _userUpdateThreadData Passed to C callback function

Implements RakPeerInterface.

Definition at line 3459 of file RakPeer.cpp.

void RakPeer::ShiftIncomingTimestamp ( unsigned char *  data,
SystemAddress  systemAddress 
) const [protected]

Adjust the timestamp of the incoming packet to be relative to this system.

Parameters:
[in] data Data in the incoming packet.
[in] systemAddress Sender of the incoming packet.

Definition at line 4129 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RakPeer::Shutdown ( unsigned int  blockDuration,
unsigned char  orderingChannel = 0,
PacketPriority  disconnectionNotificationPriority = LOW_PRIORITY 
) [virtual]

Stops the network threads and closes all connections.

Parameters:
[in] blockDuration Wait time(milli seconds) for all remaining messages to go out, including ID_DISCONNECTION_NOTIFICATION. If 0, it doesn't wait at all.
[in] orderingChannel Channel on which ID_DISCONNECTION_NOTIFICATION will be sent, if blockDuration > 0.
[in] disconnectionNotificationPriority Priority of sending ID_DISCONNECTION_NOTIFICATION. If set to 0, the disconnection notification won't be sent.

Implements RakPeerInterface.

Definition at line 930 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool RakPeer::Startup ( unsigned short  maxConnections,
int  _threadSleepTimer,
SocketDescriptor socketDescriptors,
unsigned  socketDescriptorCount,
int  threadPriority = -99999 
) [virtual]

Starts the network threads and opens the listen port.

You must call this before calling Connect().

Note:
Multiple calls while already active are ignored. To call this function again with different settings, you must first call Shutdown().
Call SetMaximumIncomingConnections if you want to accept incoming connections.
Set _RAKNET_THREADSAFE in RakNetDefines.h if you want to call RakNet functions from multiple threads (not recommended, as it is much slower and RakNet is already asynchronous).
Parameters:
[in] maxConnections Maximum number of connections between this instance of RakPeer and another instance of RakPeer. Required so that the network can preallocate and for thread safety. A pure client would set this to 1. A pure server would set it to the number of allowed clients.A hybrid would set it to the sum of both types of connections.
[in] localPort Port to listen for connections on.
[in] _threadSleepTimer Time in milliseconds for the thread to Sleep in each internal update cycle. With new congestion control, the best results will be obtained by passing 10.
[in] socketDescriptors An array of SocketDescriptor structures to force RakNet to listen on a particular IP address or port (or both). Each SocketDescriptor will represent one unique socket. Do not pass redundant structures. To listen on a specific port, you can pass SocketDescriptor(myPort,0); for a server. For a client, it is usually OK to pass SocketDescriptor();
[in] socketDescriptorCount The size of the socketDescriptors array. Pass 1 if you are not sure what to pass.
[in] threadPriority Passed to the thread creation routine. Use THREAD_PRIORITY_NORMAL for Windows. WARNING!!! On the PS3, 0 means highest priority!
Returns:
False on failure (can't create socket or thread), true on success.

Implements RakPeerInterface.

Definition at line 331 of file RakPeer.cpp.

Here is the call graph for this function:

void RakPeer::ValidateRemoteSystemLookup ( void   )  const [protected]

Definition at line 3721 of file RakPeer.cpp.

Here is the caller graph for this function:

bool RakPeer::ValidSendTarget ( SystemAddress  systemAddress,
bool  broadcast 
) [protected]

Definition at line 5052 of file RakPeer.cpp.

Here is the caller graph for this function:

void RakPeer::WriteOutOfBandHeader ( RakNet::BitStream bitStream  )  [virtual]

Implements RakPeerInterface.

Definition at line 3452 of file RakPeer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:


Friends And Related Function Documentation

void ProcessNetworkPacket ( const SystemAddress  systemAddress,
const char *  data,
const int  length,
RakPeer rakPeer,
RakNetSmartPtr< RakNetSocket rakNetSocket,
RakNetTimeUS  timeRead 
) [friend]

Definition at line 5943 of file RakPeer.cpp.

void ProcessNetworkPacket ( const SystemAddress  systemAddress,
const char *  data,
const int  length,
RakPeer rakPeer,
RakNetTimeUS  timeRead 
) [friend]

Definition at line 5939 of file RakPeer.cpp.

bool ProcessOfflineNetworkPacket ( const SystemAddress  systemAddress,
const char *  data,
const int  length,
RakPeer rakPeer,
RakNetSmartPtr< RakNetSocket rakNetSocket,
bool *  isOfflineMessage,
RakNetTimeUS  timeRead 
) [friend]

Definition at line 5446 of file RakPeer.cpp.

void ProcessPortUnreachable ( const unsigned int  binaryAddress,
const unsigned short  port,
RakPeer rakPeer 
) [friend]

Definition at line 5438 of file RakPeer.cpp.


Member Data Documentation

How long it has been since things were updated by a call to receiveUpdate thread uses this to determine how long to sleep for.

True to allow connection accepted packets from anyone. False to only allow these packets from servers we requested a connection to.

Definition at line 1112 of file RakPeer.h.

Definition at line 1127 of file RakPeer.h.

Definition at line 951 of file RakPeer.h.

Definition at line 922 of file RakPeer.h.

unsigned int RakPeer::binaryAddresses[MAXIMUM_NUMBER_OF_INTERNAL_IDS] [protected]

Definition at line 1125 of file RakPeer.h.

bool RakPeer::blockOnRPCReply [protected]

Definition at line 1071 of file RakPeer.h.

Definition at line 996 of file RakPeer.h.

Definition at line 1017 of file RakPeer.h.

unsigned int RakPeer::bytesReceivedPerSecond [protected]

Definition at line 918 of file RakPeer.h.

unsigned int RakPeer::bytesSentPerSecond [protected]

The list of people we have tried to connect to recently.

Data that both the client and the server needs

Definition at line 918 of file RakPeer.h.

unsigned int RakPeer::compressedBytesReceived [protected]

Definition at line 960 of file RakPeer.h.

unsigned int RakPeer::compressedBytesSent [protected]

Definition at line 960 of file RakPeer.h.

int RakPeer::defaultMTUSize [protected]

Definition at line 1052 of file RakPeer.h.

Definition at line 1065 of file RakPeer.h.

volatile bool RakPeer::endThreads [protected]

Set this to true to terminate the Peer thread execution.

Definition at line 863 of file RakPeer.h.

Definition at line 1114 of file RakPeer.h.

unsigned int RakPeer::frequencyTable[256] [protected]

Compression stuff.

Definition at line 958 of file RakPeer.h.

char RakPeer::incomingPassword[256] [protected]

Definition at line 877 of file RakPeer.h.

unsigned char RakPeer::incomingPasswordLength [protected]

Definition at line 878 of file RakPeer.h.

Definition at line 922 of file RakPeer.h.

Definition at line 959 of file RakPeer.h.

char RakPeer::ipList[MAXIMUM_NUMBER_OF_INTERNAL_IDS][16] [protected]

Definition at line 1124 of file RakPeer.h.

volatile bool RakPeer::isMainLoopThreadActive [protected]

true if the peer thread is active.

Definition at line 865 of file RakPeer.h.

volatile bool RakPeer::isRecvFromLoopThreadActive [protected]

Definition at line 865 of file RakPeer.h.

Definition at line 1094 of file RakPeer.h.

Definition at line 1134 of file RakPeer.h.

unsigned short RakPeer::maximumIncomingConnections [protected]

Store the maximum number of peers able to connect, including reserved connection slots for pings, etc.

Store the maximum incoming connection allowed

Definition at line 873 of file RakPeer.h.

* unsigned short RakPeer::maximumNumberOfPeers [protected]

Store the maximum number of peers allowed to connect.

Do we occasionally ping the other systems?

Definition at line 868 of file RakPeer.h.

unsigned RakPeer::maxOutgoingBPS [protected]

Definition at line 1081 of file RakPeer.h.

Definition at line 952 of file RakPeer.h.

Definition at line 1079 of file RakPeer.h.

SystemAddress RakPeer::mySystemAddress[MAXIMUM_NUMBER_OF_INTERNAL_IDS] [protected]

Local Player ID.

Definition at line 876 of file RakPeer.h.

Definition at line 1120 of file RakPeer.h.

unsigned char RakPeer::newRandomNumber[20] [protected]

Definition at line 1096 of file RakPeer.h.

bool RakPeer::occasionalPing [protected]

Definition at line 866 of file RakPeer.h.

Definition at line 874 of file RakPeer.h.

unsigned char RakPeer::oldRandomNumber[20] [protected]

Definition at line 1096 of file RakPeer.h.

Definition at line 959 of file RakPeer.h.

Definition at line 1137 of file RakPeer.h.

Definition at line 1136 of file RakPeer.h.

Definition at line 1139 of file RakPeer.h.

Definition at line 1140 of file RakPeer.h.

Definition at line 1092 of file RakPeer.h.

uint32_t RakPeer::publicKeyN[RAKNET_RSA_FACTOR_LIMBS] [protected]

Definition at line 1093 of file RakPeer.h.

Definition at line 1133 of file RakPeer.h.

SimpleMutex RakPeer::rakPeerMutexes[NUMBER_OF_RAKPEER_MUTEXES] [protected]

Definition at line 909 of file RakPeer.h.

Definition at line 1095 of file RakPeer.h.

unsigned int RakPeer::rawBytesReceived [protected]

Definition at line 960 of file RakPeer.h.

unsigned int RakPeer::rawBytesSent [protected]

Definition at line 960 of file RakPeer.h.

Definition at line 894 of file RakPeer.h.

This is an array of pointers to RemoteSystemStruct This allows us to preallocate the list when starting, so we don't have to allocate or delete at runtime. Another benefit is that is lets us add and remove active players simply by setting systemAddress and moving elements in the list by copying pointers variables without affecting running threads, even if they are in the reliability layer

Definition at line 884 of file RakPeer.h.

Definition at line 887 of file RakPeer.h.

Definition at line 1063 of file RakPeer.h.

Definition at line 1061 of file RakPeer.h.

Definition at line 1062 of file RakPeer.h.

Definition at line 954 of file RakPeer.h.

Definition at line 955 of file RakPeer.h.

Definition at line 1074 of file RakPeer.h.

RPCMap RakPeer::rpcMap [protected]

Definition at line 1051 of file RakPeer.h.

Encryption and security.

Definition at line 1091 of file RakPeer.h.

Definition at line 1122 of file RakPeer.h.

Definition at line 1048 of file RakPeer.h.

Definition at line 1148 of file RakPeer.h.

This is used to return a number to the user when they call Send identifying the message This number will be returned back with ID_SND_RECEIPT_ACKED or ID_SND_RECEIPT_LOSS and is only returned with the reliability types that contain RECEIPT in the name

Definition at line 1147 of file RakPeer.h.

Definition at line 1057 of file RakPeer.h.

Definition at line 1029 of file RakPeer.h.

Definition at line 1115 of file RakPeer.h.

int RakPeer::threadSleepTimer [protected]

Definition at line 1054 of file RakPeer.h.

bool RakPeer::trackFrequencyTable [protected]

Definition at line 1053 of file RakPeer.h.

Definition at line 1116 of file RakPeer.h.

RunUpdateCycle is not thread safe but we don't need to mutex calls. Just skip calls if it is running already.

Definition at line 912 of file RakPeer.h.

void* RakPeer::userUpdateThreadData [protected]

Definition at line 1130 of file RakPeer.h.

void(* RakPeer::userUpdateThreadPtr)(RakPeerInterface *, void *) [protected]

Definition at line 1129 of file RakPeer.h.

bool RakPeer::usingSecurity [protected]

Definition at line 1094 of file RakPeer.h.

unsigned int RakPeer::validationInteger [protected]

Definition at line 921 of file RakPeer.h.


The documentation for this class was generated from the following files: