![]() |
Shadowrun: Awakened 29 September 2011 - Build 871
|
Main interface for network communications. More...
#include <RakPeer.h>
Inheritance diagram for RakNet::RakPeer:Classes | |
| struct | BanStruct |
| struct | BufferedCommandStruct |
| struct | PingAndClockDifferential |
| struct | RecvFromStruct |
| struct | RemoteSystemStruct |
| struct | RequestedConnectionStruct |
| struct | SocketQueryOutput |
Public Member Functions | |
| void | AddToBanList (const char *IP, RakNet::TimeMS milliseconds=0) |
| Bans an IP from connecting. | |
| void | AddToSecurityExceptionList (const char *ip) |
| This is useful if you have a fixed-address internal server behind a LAN. | |
| 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. | |
| Packet * | AllocatePacket (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. | |
| void | AllowConnectionResponseIPMigration (bool allow) |
| Allow or disallow connection responses from any IP. | |
| virtual void | ApplyNetworkSimulator (float packetloss, unsigned short minExtraPing, unsigned short extraPingVariance) |
| 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 | CancelConnectionAttempt (const SystemAddress target) |
| Cancel a pending connection attempt. | |
| void | ChangeSystemAddress (RakNetGUID guid, const SystemAddress &systemAddress) |
| void | ClearBanList (void) |
| Allows all previously banned IPs to connect. | |
| void | CloseConnection (const AddressOrGUID 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). | |
| ConnectionAttemptResult | Connect (const char *host, unsigned short remotePort, const char *passwordData, int passwordDataLength, PublicKey *publicKey=0, unsigned connectionSocketIndex=0, unsigned sendConnectionAttemptCount=6, unsigned timeBetweenSendConnectionAttemptsMS=1000, RakNet::TimeMS timeoutTime=0) |
| Connect to the specified host (ip or domain name) and server port. | |
| virtual ConnectionAttemptResult | ConnectWithSocket (const char *host, unsigned short remotePort, const char *passwordData, int passwordDataLength, RakNetSmartPtr< RakNetSocket > socket, PublicKey *publicKey=0, unsigned sendConnectionAttemptCount=6, unsigned timeBetweenSendConnectionAttemptsMS=1000, RakNet::TimeMS timeoutTime=0) |
| Connect to the specified host (ip or domain name) and server port. | |
| void | DeallocatePacket (Packet *packet) |
| Call this to deallocate a message returned by Receive() when you are done handling it. | |
| void | DetachPlugin (PluginInterface2 *messageHandler) |
| Detaches a Plugin interface from the instance of the base class (RakPeer or PacketizedTCP) it is attached to. | |
| void | DisableSecurity (void) |
| int | GetAveragePing (const AddressOrGUID systemIdentifier) |
| Returns the average of all ping times read for the specific system or -1 if none read yet. | |
| bool | GetClientPublicKeyFromSystemAddress (const SystemAddress input, char *client_public_key) const |
| bool | GetConnectionList (SystemAddress *remoteSystems, unsigned short *numberOfSystems) const |
| Fills the array remoteSystems with the SystemAddress of all the systems we are connected to. | |
| ConnectionState | GetConnectionState (const AddressOrGUID systemIdentifier) |
| 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. | |
| RakNetGUID | GetGUIDFromIndex (int index) |
| Same as GetSystemAddressFromIndex but returns RakNetGUID. | |
| const RakNetGUID & | GetGuidFromSystemAddress (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. | |
| void | GetIncomingPassword (char *passwordData, int *passwordDataLength) |
| Gets the password passed to SetIncomingPassword. | |
| int | GetIndexFromSystemAddress (const SystemAddress systemAddress) const |
| Given systemAddress, returns its index into remoteSystemList. | |
| 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. | |
| int | GetLastPing (const AddressOrGUID systemIdentifier) const |
| Returns the last ping time read for the specific system or -1 if none read yet. | |
| const char * | GetLocalIP (unsigned int index) |
| int | GetLowestPing (const AddressOrGUID systemIdentifier) const |
| Returns the lowest ping time read or -1 if none read yet. | |
| unsigned short | GetMaximumIncomingConnections (void) const |
| Returns the value passed to SetMaximumIncomingConnections(). | |
| unsigned short | GetMaximumNumberOfPeers (void) const |
| Return the total number of connections we are allowed. | |
| int | GetMTUSize (const SystemAddress target) const |
| Returns the current MTU size. | |
| SystemAddress | GetMyBoundAddress (const int socketIndex=0) |
| Return the address bound to a socket at the specified index. | |
| const RakNetGUID | GetMyGUID (void) |
| Return my own GUID. | |
| virtual uint32_t | GetNextSendReceipt (void) |
| unsigned | GetNumberOfAddresses (void) |
| Returns the number of IP addresses this system has internally. | |
| void | GetOfflinePingResponse (char **data, unsigned int *length) |
| Returns pointers to a copy of the data passed to SetOfflinePingResponse. | |
| virtual unsigned int | GetReceiveBufferSize (void) |
| how many messages are waiting when you call Receive() | |
| 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. | |
| int | GetSplitMessageProgressInterval (void) const |
| Returns what was passed to SetSplitMessageProgressInterval(). | |
| bool | GetStatistics (const int index, RakNetStatistics *rns) |
| Returns the network statistics of the system at the given index in the remoteSystemList. | |
| RakNetStatistics * | 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. | |
| 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. | |
| SystemAddress | GetSystemAddressFromIndex (int index) |
| Given index into remoteSystemList, will return a SystemAddress. This function is only useful for looping through all systems. | |
| void | GetSystemList (DataStructures::List< SystemAddress > &addresses, DataStructures::List< RakNetGUID > &guids) const |
| 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. | |
| RakNet::TimeMS | GetTimeoutTime (const SystemAddress target) |
| Returns the Timeout time for the given system. | |
| virtual uint32_t | IncrementNextSendReceipt (void) |
| bool | InitializeSecurity (const char *publicKey, const char *privateKey, bool bRequireClientKey=false) |
| bool | IsActive (void) const |
| Returns true if the network thread is running. | |
| bool | IsBanned (const char *IP) |
| Returns true or false indicating if a particular IP is banned. | |
| bool | IsInSecurityExceptionList (const char *ip) |
| Checks to see if a given IP is in the security exception list. | |
| bool | IsLocalIP (const char *ip) |
| virtual bool | IsNetworkSimulatorActive (void) |
| unsigned short | NumberOfConnections (void) const |
| Returns how many open connections exist at this time. | |
| bool | Ping (const char *host, unsigned short remotePort, bool onlyReplyOnAcceptingConnections, unsigned connectionSocketIndex=0) |
| Send a ping to the specified unconnected system. | |
| void | Ping (const SystemAddress target) |
| 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. | |
| RakPeer () | |
| Constructor. | |
| Packet * | Receive (void) |
| Gets a message from the incoming message queue. | |
| virtual void | ReleaseSockets (DataStructures::List< RakNetSmartPtr< RakNetSocket > > &sockets) |
| 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 | RemoveFromSecurityExceptionList (const char *ip) |
| Remove a specific connection previously added via AddToSecurityExceptionList. | |
| uint32_t | Send (const char *data, const int length, PacketPriority priority, PacketReliability reliability, char orderingChannel, const AddressOrGUID systemIdentifier, bool broadcast, uint32_t forceReceiptNumber=0) |
| Sends a block of data to the specified system that you are connected to. | |
| uint32_t | Send (const RakNet::BitStream *bitStream, PacketPriority priority, PacketReliability reliability, char orderingChannel, const AddressOrGUID systemIdentifier, bool broadcast, uint32_t forceReceiptNumber=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 forceReceiptNumber=0) |
| Sends multiple blocks of data, concatenating them automatically. | |
| void | SendLoopback (const char *data, const int length) |
| "Send" to yourself rather than a remote system. | |
| bool | SendOutOfBand (const char *host, unsigned short remotePort, const char *data, BitSize_t dataLength, unsigned connectionSocketIndex=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 | SetIncomingPassword (const char *passwordData, int passwordDataLength) |
| Sets the password for the incoming connections. | |
| void | SetLimitIPConnectionFrequency (bool b) |
| Enable or disable allowing frequent connections from the same IP adderss. | |
| void | SetMaximumIncomingConnections (unsigned short numberAllowed) |
| Sets the maximum number of incoming connections allowed. | |
| 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. | |
| virtual void | SetPerConnectionOutgoingBandwidthLimit (unsigned maxBitsPerSecond) |
| void | SetSplitMessageProgressInterval (int interval) |
| Controls how often to return ID_DOWNLOAD_PROGRESS for large message downloads. | |
| void | SetTimeoutTime (RakNet::TimeMS timeMS, const SystemAddress target) |
| Set the time, in MS, to use before considering ourselves disconnected after not being able to deliver a reliable message. | |
| void | SetUnreliableTimeout (RakNet::TimeMS 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. | |
| virtual void | SetUserUpdateThread (void(*_userUpdateThreadPtr)(RakPeerInterface *, void *), void *_userUpdateThreadData) |
| void | Shutdown (unsigned int blockDuration, unsigned char orderingChannel=0, PacketPriority disconnectionNotificationPriority=LOW_PRIORITY) |
| Stops the network threads and closes all connections. | |
| StartupResult | Startup (unsigned short maxConnections, SocketDescriptor *socketDescriptors, unsigned socketDescriptorCount, int threadPriority=-99999) |
| Starts the network threads and opens the listen port. | |
| virtual void | WriteOutOfBandHeader (RakNet::BitStream *bitStream) |
| virtual | ~RakPeer () |
| Destructor. | |
Protected Types | |
| enum | { requestedConnectionList_Mutex, offlinePingResponse_Mutex, NUMBER_OF_RAKPEER_MUTEXES } |
Protected Member Functions | |
| void | AddPacketToProducer (RakNet::Packet *p) |
| void | AddToActiveSystemList (unsigned int remoteSystemListIndex) |
| Packet * | AllocPacket (unsigned dataSize, const char *file, unsigned int line) |
| Packet * | AllocPacket (unsigned dataSize, unsigned char *data, const char *file, unsigned int line) |
| bool | AllowIncomingConnections (void) const |
| RemoteSystemStruct * | AssignSystemAddressToRemoteSystemList (const SystemAddress systemAddress, RemoteSystemStruct::ConnectMode connectionMode, RakNetSmartPtr< RakNetSocket > incomingRakNetSocket, bool *thisIPConnectedRecently, SystemAddress bindingAddress, int incomingMTU, RakNetGUID guid, bool useSecurity) |
| Get a free remote system from the list and assign our systemAddress to it. | |
| void | ClearBufferedCommands (void) |
| void | ClearBufferedPackets (void) |
| void | ClearRemoteSystemLookup (void) |
| void | ClearRequestedConnectionList (void) |
| void | ClearSocketQueryOutput (void) |
| void | CloseConnectionInternal (const AddressOrGUID &systemIdentifier, bool sendDisconnectionNotification, bool performImmediate, unsigned char orderingChannel, PacketPriority disconnectionNotificationPriority) |
| void | DerefAllSockets (void) |
| void | DereferenceRemoteSystem (const SystemAddress &sa) |
| void | GenerateGUID (void) |
| unsigned int | GenerateSeedFromGuid (void) |
| RakNet::Time | GetBestClockDifferential (const SystemAddress systemAddress) const |
| int | GetIndexFromGuid (const RakNetGUID guid) |
| int | GetIndexFromSystemAddress (const SystemAddress systemAddress, bool calledFromNetworkThread) const |
| SystemAddress | GetLoopbackAddress (void) const |
| unsigned short | GetNumberOfRemoteInitiatedConnections (void) const |
| Returns how many remote systems initiated a connection to us. | |
| unsigned int | GetRakNetSocketFromUserConnectionSocketIndex (unsigned int userIndex) const |
| RemoteSystemStruct * | GetRemoteSystem (const SystemAddress &sa) const |
| RakPeer::RemoteSystemStruct * | GetRemoteSystem (const AddressOrGUID systemIdentifier, bool calledFromNetworkThread, bool onlyActive) const |
| RemoteSystemStruct * | GetRemoteSystemFromGUID (const RakNetGUID guid, bool onlyActive) const |
| RemoteSystemStruct * | GetRemoteSystemFromSystemAddress (const SystemAddress systemAddress, bool calledFromNetworkThread, bool onlyActive) const |
| unsigned int | GetRemoteSystemIndex (const SystemAddress &sa) const |
| unsigned int | GetSystemIndexFromGuid (const RakNetGUID input) const |
| bool | IsLoopbackAddress (const AddressOrGUID &systemIdentifier, bool matchPort) const |
| 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. | |
| void | OnConnectedPong (RakNet::Time sendPingTime, RakNet::Time sendPongTime, RemoteSystemStruct *remoteSystem) |
| void | OnConnectionRequest (RakPeer::RemoteSystemStruct *remoteSystem, RakNet::Time incomingTimestamp) |
| void | ParseConnectionRequestPacket (RakPeer::RemoteSystemStruct *remoteSystem, const SystemAddress &systemAddress, const char *data, int byteSize) |
| Parse out a connection request packet. | |
| void | PingInternal (const SystemAddress target, bool performImmediate, PacketReliability reliability) |
| void | ReferenceRemoteSystem (const SystemAddress &sa, unsigned int remoteSystemListIndex) |
| unsigned int | RemoteSystemLookupHashIndex (const SystemAddress &sa) const |
| void | RemoveFromActiveSystemList (const SystemAddress &sa) |
| void | ResetSendReceipt (void) |
| bool | RunUpdateCycle (RakNet::TimeUS timeNS, RakNet::Time timeMS) |
| 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) |
| ConnectionAttemptResult | SendConnectionRequest (const char *host, unsigned short remotePort, const char *passwordData, int passwordDataLength, PublicKey *publicKey, unsigned connectionSocketIndex, unsigned int extraData, unsigned sendConnectionAttemptCount, unsigned timeBetweenSendConnectionAttemptsMS, RakNet::TimeMS timeoutTime) |
| ConnectionAttemptResult | SendConnectionRequest (const char *host, unsigned short remotePort, const char *passwordData, int passwordDataLength, PublicKey *publicKey, unsigned connectionSocketIndex, unsigned int extraData, unsigned sendConnectionAttemptCount, unsigned timeBetweenSendConnectionAttemptsMS, RakNet::TimeMS timeoutTime, RakNetSmartPtr< RakNetSocket > socket) |
| bool | SendImmediate (char *data, BitSize_t numberOfBitsToSend, PacketPriority priority, PacketReliability reliability, char orderingChannel, const AddressOrGUID systemIdentifier, bool broadcast, bool useCallerDataAllocation, RakNet::TimeUS currentTime, uint32_t receipt) |
| void | ShiftIncomingTimestamp (unsigned char *data, const SystemAddress &systemAddress) const |
| Adjust the timestamp of the incoming packet to be relative to this system. | |
| void | ValidateRemoteSystemLookup (void) const |
Protected Attributes | |
| RemoteSystemStruct ** | activeSystemList |
| unsigned int | activeSystemListSize |
| 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. | |
| bool | allowInternalRouting |
| DataStructures::List< BanStruct * > | banList |
| SimpleMutex | banListMutex |
| DataStructures::ThreadsafeAllocatingQueue < BufferedCommandStruct > | bufferedCommands |
| DataStructures::ThreadsafeAllocatingQueue < RecvFromStruct > | bufferedPackets |
| unsigned int | bytesReceivedPerSecond |
| unsigned int | bytesSentPerSecond |
| The list of people we have tried to connect to recently. | |
| int | defaultMTUSize |
| RakNet::TimeMS | defaultTimeoutTime |
| volatile bool | endThreads |
| Set this to true to terminate the Peer thread execution. | |
| SystemAddress | firstExternalID |
| char | incomingPassword [256] |
| Local Player ID. | |
| unsigned char | incomingPasswordLength |
| SimpleMutex | incomingQueueMutex |
| SystemAddress | ipList [10] |
| volatile bool | isMainLoopThreadActive |
| true if the peer thread is active. | |
| RakNet::LocklessUint32_t | isRecvFromLoopThreadActive |
| bool | limitConnectionFrequencyFromTheSameIP |
| unsigned short | maximumIncomingConnections |
| Store the maximum number of peers able to connect, including reserved connection slots for pings, etc. | |
| *unsigned short | maximumNumberOfPeers |
| Store the maximum number of peers allowed to connect. | |
| unsigned | maxOutgoingBPS |
| DataStructures::List < PluginInterface2 * > | messageHandlerList |
| RakNetGUID | myGuid |
| bool | occasionalPing |
| RakNet::BitStream | offlinePingResponse |
| DataStructures::MemoryPool < Packet > | packetAllocationPool |
| SimpleMutex | packetAllocationPoolMutex |
| SimpleMutex | packetReturnMutex |
| DataStructures::Queue< Packet * > | packetReturnQueue |
| SignaledEvent | quitAndDataEvents |
| SimpleMutex | rakPeerMutexes [NUMBER_OF_RAKPEER_MUTEXES] |
| DataStructures::MemoryPool < RemoteSystemIndex > | remoteSystemIndexPool |
| RemoteSystemStruct * | remoteSystemList |
| RemoteSystemIndex ** | remoteSystemLookup |
| bool | replyFromTargetBroadcast |
| RakNet::BitStream * | replyFromTargetBS |
| SystemAddress | replyFromTargetPlayer |
| DataStructures::Queue < RequestedConnectionStruct * > | requestedConnectionQueue |
| SimpleMutex | requestedConnectionQueueMutex |
| DataStructures::List < RakNet::RakString > | securityExceptionList |
| SimpleMutex | securityExceptionMutex |
| uint32_t | sendReceiptSerial |
| SimpleMutex | sendReceiptSerialMutex |
| DataStructures::List < RakNetSmartPtr< RakNetSocket > > | socketList |
| DataStructures::ThreadsafeAllocatingQueue < SocketQueryOutput > | socketQueryOutput |
| int | splitMessageProgressInterval |
| bool | trackFrequencyTable |
| RakNet::TimeMS | unreliableTimeout |
| bool | updateCycleIsRunning |
| RunUpdateCycle is not thread safe but we don't need to mutex calls. Just skip calls if it is running already. | |
| void * | userUpdateThreadData |
| void(* | userUpdateThreadPtr )(RakPeerInterface *, void *) |
| unsigned int | validationInteger |
Friends | |
| void | ProcessNetworkPacket (const SystemAddress systemAddress, const char *data, const int length, RakPeer *rakPeer, RakNet::TimeUS timeRead) |
| void | ProcessNetworkPacket (const SystemAddress systemAddress, const char *data, const int length, RakPeer *rakPeer, RakNetSmartPtr< RakNetSocket > rakNetSocket, RakNet::TimeUS timeRead) |
| bool | ProcessOfflineNetworkPacket (SystemAddress systemAddress, const char *data, const int length, RakPeer *rakPeer, RakNetSmartPtr< RakNetSocket > rakNetSocket, bool *isOfflineMessage, RakNet::TimeUS timeRead) |
| void * | RecvFromLoop (void *arguments) |
| void * | UDTConnect (void *arguments) |
| void * | UpdateNetworkLoop (void *arguments) |
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.
anonymous enum [protected] |
Definition at line 747 of file RakPeer.h.
{
// Only put these mutexes in user thread functions!
requestedConnectionList_Mutex,
offlinePingResponse_Mutex,
NUMBER_OF_RAKPEER_MUTEXES
};
| RakNet::RakPeer::RakPeer | ( | ) |
| virtual RakNet::RakPeer::~RakPeer | ( | ) | [virtual] |
| void RakNet::RakPeer::AddPacketToProducer | ( | RakNet::Packet * | p | ) | [protected] |
| void RakNet::RakPeer::AddToActiveSystemList | ( | unsigned int | remoteSystemListIndex | ) | [protected] |
| void RakNet::RakPeer::AddToBanList | ( | const char * | IP, |
| RakNet::TimeMS | milliseconds = 0 |
||
| ) | [virtual] |
Banned IPs persist between connections but are not saved on shutdown nor loaded on startup.
| [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 RakNet::RakPeerInterface.
| void RakNet::RakPeer::AddToSecurityExceptionList | ( | const char * | ip | ) | [virtual] |
Secure connections are determined by the recipient of an incoming connection. This has no effect if called on the system attempting to connect.
| [in] | ip | IP address to add. * wildcards are supported. |
Implements RakNet::RakPeerInterface.
| bool RakNet::RakPeer::AdvertiseSystem | ( | const char * | host, |
| unsigned short | remotePort, | ||
| const char * | data, | ||
| int | dataLength, | ||
| unsigned | connectionSocketIndex = 0 |
||
| ) | [virtual] |
| [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. |
Implements RakNet::RakPeerInterface.
| Packet* RakNet::RakPeer::AllocatePacket | ( | unsigned | dataSize | ) | [virtual] |
| [in] | dataSize | How many bytes to allocate for the buffer |
Implements RakNet::RakPeerInterface.
| Packet* RakNet::RakPeer::AllocPacket | ( | unsigned | dataSize, |
| const char * | file, | ||
| unsigned int | line | ||
| ) | [protected] |
| Packet* RakNet::RakPeer::AllocPacket | ( | unsigned | dataSize, |
| unsigned char * | data, | ||
| const char * | file, | ||
| unsigned int | line | ||
| ) | [protected] |
| void RakNet::RakPeer::AllowConnectionResponseIPMigration | ( | bool | allow | ) | [virtual] |
Normally this should be false, but may be necessary when connecting to servers with multiple IP addresses.
| [in] | allow | - True to allow this behavior, false to not allow. Defaults to false. Value persists between connections. |
Implements RakNet::RakPeerInterface.
| bool RakNet::RakPeer::AllowIncomingConnections | ( | void | ) | const [protected] |
| virtual void RakNet::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 packetloss value on each. You can exclude network simulator code with the _RELEASE #define to decrease code size
| [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 RakNet::RakPeerInterface.
| RemoteSystemStruct* RakNet::RakPeer::AssignSystemAddressToRemoteSystemList | ( | const SystemAddress | systemAddress, |
| RemoteSystemStruct::ConnectMode | connectionMode, | ||
| RakNetSmartPtr< RakNetSocket > | incomingRakNetSocket, | ||
| bool * | thisIPConnectedRecently, | ||
| SystemAddress | bindingAddress, | ||
| int | incomingMTU, | ||
| RakNetGUID | guid, | ||
| bool | useSecurity | ||
| ) | [protected] |
| [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 |
| void RakNet::RakPeer::AttachPlugin | ( | PluginInterface2 * | plugin | ) | [virtual] |
| [in] | messageHandler | Pointer to the plugin to attach. |
Implements RakNet::RakPeerInterface.
| void RakNet::RakPeer::CancelConnectionAttempt | ( | const SystemAddress | target | ) | [virtual] |
If we are already connected, the connection stays open
| [in] | target | Target system to cancel. |
Implements RakNet::RakPeerInterface.
| void RakNet::RakPeer::ChangeSystemAddress | ( | RakNetGUID | guid, |
| const SystemAddress & | systemAddress | ||
| ) | [virtual] |
Implements RakNet::RakPeerInterface.
| void RakNet::RakPeer::ClearBanList | ( | void | ) | [virtual] |
Implements RakNet::RakPeerInterface.
| void RakNet::RakPeer::ClearBufferedCommands | ( | void | ) | [protected] |
| void RakNet::RakPeer::ClearBufferedPackets | ( | void | ) | [protected] |
| void RakNet::RakPeer::ClearRemoteSystemLookup | ( | void | ) | [protected] |
| void RakNet::RakPeer::ClearRequestedConnectionList | ( | void | ) | [protected] |
| void RakNet::RakPeer::ClearSocketQueryOutput | ( | void | ) | [protected] |
| void RakNet::RakPeer::CloseConnection | ( | const AddressOrGUID | target, |
| bool | sendDisconnectionNotification, | ||
| unsigned char | orderingChannel = 0, |
||
| PacketPriority | disconnectionNotificationPriority = LOW_PRIORITY |
||
| ) | [virtual] |
This method closes the connection irrespective of who initiated the connection.
| [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 RakNet::RakPeerInterface.
| void RakNet::RakPeer::CloseConnectionInternal | ( | const AddressOrGUID & | systemIdentifier, |
| bool | sendDisconnectionNotification, | ||
| bool | performImmediate, | ||
| unsigned char | orderingChannel, | ||
| PacketPriority | disconnectionNotificationPriority | ||
| ) | [protected] |
| ConnectionAttemptResult RakNet::RakPeer::Connect | ( | const char * | host, |
| unsigned short | remotePort, | ||
| const char * | passwordData, | ||
| int | passwordDataLength, | ||
| PublicKey * | publicKey = 0, |
||
| unsigned | connectionSocketIndex = 0, |
||
| unsigned | sendConnectionAttemptCount = 6, |
||
| unsigned | timeBetweenSendConnectionAttemptsMS = 1000, |
||
| RakNet::TimeMS | timeoutTime = 0 |
||
| ) | [virtual] |
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 GetConnectionState() returns IS_CONNECTED or Receive() gets a message with the type identifier ID_CONNECTION_REQUEST_ACCEPTED. If the connection is not successful, such as a rejected connection or no response then neither of these things will happen.
| [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] | publicKey | The public key the server is using. If 0, the server is not using security. If non-zero, the publicKeyMode member determines how to connect |
| [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. Under low bandwidth conditions with multiple simultaneous outgoing connections, this value should be raised to 1000 or higher, or else the MTU detection can overrun the available bandwidth. |
| [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); |
Implements RakNet::RakPeerInterface.
| virtual ConnectionAttemptResult RakNet::RakPeer::ConnectWithSocket | ( | const char * | host, |
| unsigned short | remotePort, | ||
| const char * | passwordData, | ||
| int | passwordDataLength, | ||
| RakNetSmartPtr< RakNetSocket > | socket, | ||
| PublicKey * | publicKey = 0, |
||
| unsigned | sendConnectionAttemptCount = 6, |
||
| unsigned | timeBetweenSendConnectionAttemptsMS = 1000, |
||
| RakNet::TimeMS | timeoutTime = 0 |
||
| ) | [virtual] |
| [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.. Under low bandwidth conditions with multiple simultaneous outgoing connections, this value should be raised to 1000 or higher, or else the MTU detection can overrun the available bandwidth. |
| [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); |
Implements RakNet::RakPeerInterface.
| void RakNet::RakPeer::DeallocatePacket | ( | Packet * | packet | ) | [virtual] |
| [in] | packet | Message to deallocate. |
Implements RakNet::RakPeerInterface.
| void RakNet::RakPeer::DerefAllSockets | ( | void | ) | [protected] |
| void RakNet::RakPeer::DereferenceRemoteSystem | ( | const SystemAddress & | sa | ) | [protected] |
| void RakNet::RakPeer::DetachPlugin | ( | PluginInterface2 * | messageHandler | ) | [virtual] |
This method disables the plugin code from running automatically on base class's updates or message receipt.
| [in] | messageHandler | Pointer to a plugin to detach. |
Implements RakNet::RakPeerInterface.
| void RakNet::RakPeer::DisableSecurity | ( | void | ) | [virtual] |
Disables security for incoming connections.
Implements RakNet::RakPeerInterface.
| void RakNet::RakPeer::GenerateGUID | ( | void | ) | [protected] |
| unsigned int RakNet::RakPeer::GenerateSeedFromGuid | ( | void | ) | [protected] |
| int RakNet::RakPeer::GetAveragePing | ( | const AddressOrGUID | systemIdentifier | ) | [virtual] |
| [in] | systemAddress | Which system we are referring to |
Implements RakNet::RakPeerInterface.
| RakNet::Time RakNet::RakPeer::GetBestClockDifferential | ( | const SystemAddress | systemAddress | ) | const [protected] |
Get the most accurate clock differential for a certain player.
| [in] | systemAddress | The player with whose clock the time difference is calculated. |
| bool RakNet::RakPeer::GetClientPublicKeyFromSystemAddress | ( | const SystemAddress | input, |
| char * | client_public_key | ||
| ) | const [virtual] |
Given the SystemAddress of a connected system, get the public key they provided as an identity Returns false if system address was not found or client public key is not known
| [in] | input | The RakNetGUID of the system |
| [in] | client_public_key | The connected client's public key is copied to this address. Buffer must be cat::EasyHandshake::PUBLIC_KEY_BYTES bytes in length. |
Implements RakNet::RakPeerInterface.
| bool RakNet::RakPeer::GetConnectionList | ( | SystemAddress * | remoteSystems, |
| unsigned short * | numberOfSystems | ||
| ) | const [virtual] |
| [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 RakNet::RakPeerInterface.
| ConnectionState RakNet::RakPeer::GetConnectionState | ( | const AddressOrGUID | systemIdentifier | ) | [virtual] |
Returns if a system is connected, disconnected, connecting in progress, or various other states
| [in] | systemIdentifier | The system we are referring to |
Implements RakNet::RakPeerInterface.
| SystemAddress RakNet::RakPeer::GetExternalID | ( | const SystemAddress | target | ) | const [virtual] |
| [in] | target | The SystemAddress of the remote system. Usually the same for all systems, unless you have two or more network cards. |
Implements RakNet::RakPeerInterface.
| RakNetGUID RakNet::RakPeer::GetGUIDFromIndex | ( | int | index | ) | [virtual] |
| [in] | index | Index should range between 0 and the maximum number of players allowed - 1. |
Implements RakNet::RakPeerInterface.
| const RakNetGUID& RakNet::RakPeer::GetGuidFromSystemAddress | ( | const SystemAddress | input | ) | const [virtual] |
| [in] | input | The system address of the target system we are connected to. |
Implements RakNet::RakPeerInterface.
| void RakNet::RakPeer::GetIncomingPassword | ( | char * | passwordData, |
| int * | passwordDataLength | ||
| ) | [virtual] |
| [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 RakNet::RakPeerInterface.
| int RakNet::RakPeer::GetIndexFromGuid | ( | const RakNetGUID | guid | ) | [protected] |
| int RakNet::RakPeer::GetIndexFromSystemAddress | ( | const SystemAddress | systemAddress | ) | const [virtual] |
Values range from 0 to the maximum number of players allowed - 1. This includes systems which were formerly connected, but are now not connected.
| [in] | systemAddress | The SystemAddress we are referring to |
Implements RakNet::RakPeerInterface.
| int RakNet::RakPeer::GetIndexFromSystemAddress | ( | const SystemAddress | systemAddress, |
| bool | calledFromNetworkThread | ||
| ) | const [protected] |
| SystemAddress RakNet::RakPeer::GetInternalID | ( | const SystemAddress | systemAddress = UNASSIGNED_SYSTEM_ADDRESS, |
| const int | index = 0 |
||
| ) | const [virtual] |
| [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) |
Implements RakNet::RakPeerInterface.
| int RakNet::RakPeer::GetLastPing | ( | const AddressOrGUID | systemIdentifier | ) | const [virtual] |
| [in] | systemAddress | Which system we are referring to |
Implements RakNet::RakPeerInterface.
| const char* RakNet::RakPeer::GetLocalIP | ( | unsigned int | index | ) | [virtual] |
Returns an IP address at index 0 to GetNumberOfAddresses-1 in ipList array.
| [in] | index | index into the list of IP addresses |
Implements RakNet::RakPeerInterface.
| SystemAddress RakNet::RakPeer::GetLoopbackAddress | ( | void | ) | const [protected] |
| int RakNet::RakPeer::GetLowestPing | ( | const AddressOrGUID | systemIdentifier | ) | const [virtual] |
| [in] | systemAddress | Which system we are referring to |
Implements RakNet::RakPeerInterface.
| unsigned short RakNet::RakPeer::GetMaximumIncomingConnections | ( | void | ) | const [virtual] |
Implements RakNet::RakPeerInterface.
| unsigned short RakNet::RakPeer::GetMaximumNumberOfPeers | ( | void | ) | const [virtual] |
Implements RakNet::RakPeerInterface.
| int RakNet::RakPeer::GetMTUSize | ( | const SystemAddress | target | ) | const [virtual] |
| [in] | target | Which system to get MTU for. UNASSIGNED_SYSTEM_ADDRESS to get the default |
Implements RakNet::RakPeerInterface.
| SystemAddress RakNet::RakPeer::GetMyBoundAddress | ( | const int | socketIndex = 0 | ) | [virtual] |
Implements RakNet::RakPeerInterface.
| const RakNetGUID RakNet::RakPeer::GetMyGUID | ( | void | ) | [virtual] |
Implements RakNet::RakPeerInterface.
| virtual uint32_t RakNet::RakPeer::GetNextSendReceipt | ( | void | ) | [virtual] |
Returns the next uint32_t that Send() will return
Implements RakNet::RakPeerInterface.
| unsigned RakNet::RakPeer::GetNumberOfAddresses | ( | void | ) | [virtual] |
Get the actual addresses from GetLocalIP()
Implements RakNet::RakPeerInterface.
| unsigned short RakNet::RakPeer::GetNumberOfRemoteInitiatedConnections | ( | void | ) | const [protected] |
| void RakNet::RakPeer::GetOfflinePingResponse | ( | char ** | data, |
| unsigned int * | length | ||
| ) | [virtual] |
| [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() |
Implements RakNet::RakPeerInterface.
| unsigned int RakNet::RakPeer::GetRakNetSocketFromUserConnectionSocketIndex | ( | unsigned int | userIndex | ) | const [protected] |
| virtual unsigned int RakNet::RakPeer::GetReceiveBufferSize | ( | void | ) | [virtual] |
Implements RakNet::RakPeerInterface.
| RakPeer::RemoteSystemStruct* RakNet::RakPeer::GetRemoteSystem | ( | const AddressOrGUID | systemIdentifier, |
| bool | calledFromNetworkThread, | ||
| bool | onlyActive | ||
| ) | const [protected] |
| RemoteSystemStruct* RakNet::RakPeer::GetRemoteSystem | ( | const SystemAddress & | sa | ) | const [protected] |
| RemoteSystemStruct* RakNet::RakPeer::GetRemoteSystemFromGUID | ( | const RakNetGUID | guid, |
| bool | onlyActive | ||
| ) | const [protected] |
| RemoteSystemStruct* RakNet::RakPeer::GetRemoteSystemFromSystemAddress | ( | const SystemAddress | systemAddress, |
| bool | calledFromNetworkThread, | ||
| bool | onlyActive | ||
| ) | const [protected] |
Get the reliability layer associated with a systemAddress.
| [in] | systemAddress | The player identifier |
| unsigned int RakNet::RakPeer::GetRemoteSystemIndex | ( | const SystemAddress & | sa | ) | const [protected] |
| virtual RakNetSmartPtr<RakNetSocket> RakNet::RakPeer::GetSocket | ( | const SystemAddress | target | ) | [virtual] |
| [in] | target | Which system. |
Implements RakNet::RakPeerInterface.
| virtual void RakNet::RakPeer::GetSockets | ( | DataStructures::List< RakNetSmartPtr< RakNetSocket > > & | sockets | ) | [virtual] |
| [out] | sockets | List of RakNetSocket structures in use. Sockets will not be closed until sockets goes out of scope |
Implements RakNet::RakPeerInterface.
| int RakNet::RakPeer::GetSplitMessageProgressInterval | ( | void | ) | const [virtual] |
Implements RakNet::RakPeerInterface.
| RakNetStatistics* RakNet::RakPeer::GetStatistics | ( | const SystemAddress | systemAddress, |
| RakNetStatistics * | rns = 0 |
||
| ) | [virtual] |
| [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. |
Implements RakNet::RakPeerInterface.
| bool RakNet::RakPeer::GetStatistics | ( | const int | index, |
| RakNetStatistics * | rns | ||
| ) | [virtual] |
Implements RakNet::RakPeerInterface.
| SystemAddress RakNet::RakPeer::GetSystemAddressFromGuid | ( | const RakNetGUID | input | ) | const [virtual] |
| [in] | input | The RakNetGUID of the target system. |
Implements RakNet::RakPeerInterface.
| SystemAddress RakNet::RakPeer::GetSystemAddressFromIndex | ( | int | index | ) | [virtual] |
| [in] | index | Index should range between 0 and the maximum number of players allowed - 1. |
Implements RakNet::RakPeerInterface.
| unsigned int RakNet::RakPeer::GetSystemIndexFromGuid | ( | const RakNetGUID | input | ) | const [protected] |
| void RakNet::RakPeer::GetSystemList | ( | DataStructures::List< SystemAddress > & | addresses, |
| DataStructures::List< RakNetGUID > & | guids | ||
| ) | const [virtual] |
| [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 RakNet::RakPeerInterface.
| RakNet::TimeMS RakNet::RakPeer::GetTimeoutTime | ( | const SystemAddress | target | ) | [virtual] |
| [in] | target | Target system to get the TimeoutTime for. Pass UNASSIGNED_SYSTEM_ADDRESS to get the default value. |
Implements RakNet::RakPeerInterface.
| virtual uint32_t RakNet::RakPeer::IncrementNextSendReceipt | ( | void | ) | [virtual] |
Returns the next uint32_t that Send() will return, and increments the value by one
Implements RakNet::RakPeerInterface.
| bool RakNet::RakPeer::InitializeSecurity | ( | const char * | publicKey, |
| const char * | privateKey, | ||
| bool | bRequireClientKey = false |
||
| ) | [virtual] |
If you accept connections, you must call this or else security will not be enabled for incoming connections. This feature requires more round trips, bandwidth, and CPU time for the connection handshake x64 builds require under 25% of the CPU time of other builds See the Encryption sample for example usage
| [in] | publicKey | A pointer to the public key for accepting new connections |
| [in] | privateKey | A pointer to the private key for accepting new connections |
| [in] | bRequireClientKey,: | Should be set to false for most servers. Allows the server to accept a public key from connecting clients as a proof of identity but eats twice as much CPU time as a normal connection |
Implements RakNet::RakPeerInterface.
| bool RakNet::RakPeer::IsActive | ( | void | ) | const [virtual] |
Implements RakNet::RakPeerInterface.
| bool RakNet::RakPeer::IsBanned | ( | const char * | IP | ) | [virtual] |
| [in] | IP | Dotted IP address. |
Implements RakNet::RakPeerInterface.
| bool RakNet::RakPeer::IsInSecurityExceptionList | ( | const char * | ip | ) | [virtual] |
| [in] | IP | address to check. |
Implements RakNet::RakPeerInterface.
| bool RakNet::RakPeer::IsLocalIP | ( | const char * | ip | ) | [virtual] |
Is this a local IP? Checks if this ip is in the ipList array.
| [in] | An | IP address to check, excluding the port. |
Implements RakNet::RakPeerInterface.
| bool RakNet::RakPeer::IsLoopbackAddress | ( | const AddressOrGUID & | systemIdentifier, |
| bool | matchPort | ||
| ) | const [protected] |
| virtual bool RakNet::RakPeer::IsNetworkSimulatorActive | ( | void | ) | [virtual] |
Returns if you previously called ApplyNetworkSimulator
Implements RakNet::RakPeerInterface.
| void RakNet::RakPeer::NotifyAndFlagForShutdown | ( | const SystemAddress | systemAddress, |
| bool | performImmediate, | ||
| unsigned char | orderingChannel, | ||
| PacketPriority | disconnectionNotificationPriority | ||
| ) | [protected] |
| unsigned short RakNet::RakPeer::NumberOfConnections | ( | void | ) | const [virtual] |
Implements RakNet::RakPeerInterface.
| void RakNet::RakPeer::OnConnectedPong | ( | RakNet::Time | sendPingTime, |
| RakNet::Time | sendPongTime, | ||
| RemoteSystemStruct * | remoteSystem | ||
| ) | [protected] |
| void RakNet::RakPeer::OnConnectionRequest | ( | RakPeer::RemoteSystemStruct * | remoteSystem, |
| RakNet::Time | incomingTimestamp | ||
| ) | [protected] |
| void RakNet::RakPeer::ParseConnectionRequestPacket | ( | RakPeer::RemoteSystemStruct * | remoteSystem, |
| const SystemAddress & | systemAddress, | ||
| const char * | data, | ||
| int | byteSize | ||
| ) | [protected] |
| void RakNet::RakPeer::Ping | ( | const SystemAddress | target | ) | [virtual] |
Send a ping to the specified connected system.
| [in] | target | Which system to ping |
Implements RakNet::RakPeerInterface.
| bool RakNet::RakPeer::Ping | ( | const char * | host, |
| unsigned short | remotePort, | ||
| bool | onlyReplyOnAcceptingConnections, | ||
| unsigned | connectionSocketIndex = 0 |
||
| ) | [virtual] |
The remote system, if it is Initialized, will respond with ID_PONG followed by sizeof(RakNet::TimeMS) 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
| [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. |
Implements RakNet::RakPeerInterface.
| void RakNet::RakPeer::PingInternal | ( | const SystemAddress | target, |
| bool | performImmediate, | ||
| PacketReliability | reliability | ||
| ) | [protected] |
| [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. |
Implements RakNet::RakPeerInterface.
| Packet* RakNet::RakPeer::Receive | ( | void | ) | [virtual] |
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.
Implements RakNet::RakPeerInterface.
| void RakNet::RakPeer::ReferenceRemoteSystem | ( | const SystemAddress & | sa, |
| unsigned int | remoteSystemListIndex | ||
| ) | [protected] |
| virtual void RakNet::RakPeer::ReleaseSockets | ( | DataStructures::List< RakNetSmartPtr< RakNetSocket > > & | sockets | ) | [virtual] |
Implements RakNet::RakPeerInterface.
| unsigned int RakNet::RakPeer::RemoteSystemLookupHashIndex | ( | const SystemAddress & | sa | ) | const [protected] |
| void RakNet::RakPeer::RemoveFromActiveSystemList | ( | const SystemAddress & | sa | ) | [protected] |
| void RakNet::RakPeer::RemoveFromBanList | ( | const char * | IP | ) | [virtual] |
Implements RakNet::RakPeerInterface.
| void RakNet::RakPeer::RemoveFromSecurityExceptionList | ( | const char * | ip | ) | [virtual] |
| [in] | ip | IP address to remove. Pass 0 to remove all IP addresses. * wildcards are supported. |
Implements RakNet::RakPeerInterface.
| void RakNet::RakPeer::ResetSendReceipt | ( | void | ) | [protected] |
| bool RakNet::RakPeer::RunUpdateCycle | ( | RakNet::TimeUS | timeNS, |
| RakNet::Time | timeMS | ||
| ) | [protected] |
| uint32_t RakNet::RakPeer::Send | ( | const RakNet::BitStream * | bitStream, |
| PacketPriority | priority, | ||
| PacketReliability | reliability, | ||
| char | orderingChannel, | ||
| const AddressOrGUID | systemIdentifier, | ||
| bool | broadcast, | ||
| uint32_t | forceReceiptNumber = 0 |
||
| ) | [virtual] |
Same as the above version, but takes a BitStream as input.
| [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. |
Implements RakNet::RakPeerInterface.
| uint32_t RakNet::RakPeer::Send | ( | const char * | data, |
| const int | length, | ||
| PacketPriority | priority, | ||
| PacketReliability | reliability, | ||
| char | orderingChannel, | ||
| const AddressOrGUID | systemIdentifier, | ||
| bool | broadcast, | ||
| uint32_t | forceReceiptNumber = 0 |
||
| ) | [virtual] |
| [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. |
Implements RakNet::RakPeerInterface.
| void RakNet::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] |
| void RakNet::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] |
| ConnectionAttemptResult RakNet::RakPeer::SendConnectionRequest | ( | const char * | host, |
| unsigned short | remotePort, | ||
| const char * | passwordData, | ||
| int | passwordDataLength, | ||
| PublicKey * | publicKey, | ||
| unsigned | connectionSocketIndex, | ||
| unsigned int | extraData, | ||
| unsigned | sendConnectionAttemptCount, | ||
| unsigned | timeBetweenSendConnectionAttemptsMS, | ||
| RakNet::TimeMS | timeoutTime, | ||
| RakNetSmartPtr< RakNetSocket > | socket | ||
| ) | [protected] |
| ConnectionAttemptResult RakNet::RakPeer::SendConnectionRequest | ( | const char * | host, |
| unsigned short | remotePort, | ||
| const char * | passwordData, | ||
| int | passwordDataLength, | ||
| PublicKey * | publicKey, | ||
| unsigned | connectionSocketIndex, | ||
| unsigned int | extraData, | ||
| unsigned | sendConnectionAttemptCount, | ||
| unsigned | timeBetweenSendConnectionAttemptsMS, | ||
| RakNet::TimeMS | timeoutTime | ||
| ) | [protected] |
| bool RakNet::RakPeer::SendImmediate | ( | char * | data, |
| BitSize_t | numberOfBitsToSend, | ||
| PacketPriority | priority, | ||
| PacketReliability | reliability, | ||
| char | orderingChannel, | ||
| const AddressOrGUID | systemIdentifier, | ||
| bool | broadcast, | ||
| bool | useCallerDataAllocation, | ||
| RakNet::TimeUS | currentTime, | ||
| uint32_t | receipt | ||
| ) | [protected] |
| uint32_t RakNet::RakPeer::SendList | ( | const char ** | data, |
| const int * | lengths, | ||
| const int | numParameters, | ||
| PacketPriority | priority, | ||
| PacketReliability | reliability, | ||
| char | orderingChannel, | ||
| const AddressOrGUID | systemIdentifier, | ||
| bool | broadcast, | ||
| uint32_t | forceReceiptNumber = 0 |
||
| ) | [virtual] |
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.
| [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. |
Implements RakNet::RakPeerInterface.
| void RakNet::RakPeer::SendLoopback | ( | const char * | data, |
| const int | length | ||
| ) | [virtual] |
The message will be processed through the plugins and returned to the game as usual. This function works anytime
| [in] | data | Block of data to send. |
| [in] | length | Size in bytes of the data to send. |
Implements RakNet::RakPeerInterface.
| bool RakNet::RakPeer::SendOutOfBand | ( | const char * | host, |
| unsigned short | remotePort, | ||
| const char * | data, | ||
| BitSize_t | dataLength, | ||
| unsigned | connectionSocketIndex = 0 |
||
| ) | [virtual] |
Implements RakNet::RakPeerInterface.
| void RakNet::RakPeer::SendTTL | ( | const char * | host, |
| unsigned short | remotePort, | ||
| int | ttl, | ||
| unsigned | connectionSocketIndex = 0 |
||
| ) | [virtual] |
This message will not reach the host, but will open the router.
| [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. |
Implements RakNet::RakPeerInterface.
| void RakNet::RakPeer::SetIncomingPassword | ( | const char * | passwordData, |
| int | passwordDataLength | ||
| ) | [virtual] |
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.
| [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 RakNet::RakPeerInterface.
| void RakNet::RakPeer::SetLimitIPConnectionFrequency | ( | bool | b | ) | [virtual] |
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.
| [in] | b | True to limit connections from the same ip to at most 1 per 100 milliseconds. |
Implements RakNet::RakPeerInterface.
| void RakNet::RakPeer::SetMaximumIncomingConnections | ( | unsigned short | numberAllowed | ) | [virtual] |
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
| [in] | numberAllowed | Maximum number of incoming connections allowed. |
Implements RakNet::RakPeerInterface.
| void RakNet::RakPeer::SetOccasionalPing | ( | bool | doPing | ) | [virtual] |
Ping the remote systems every so often, or not. Can be called anytime. By default this is true. Recommended to leave on, because congestion control uses it to determine how often to resend lost packets. 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
| [in] | doPing | True to start occasional pings. False to stop them. |
Implements RakNet::RakPeerInterface.
| void RakNet::RakPeer::SetOfflinePingResponse | ( | const char * | data, |
| const unsigned int | length | ||
| ) | [virtual] |
| [in] | data | Block of data to send, or 0 for none |
| [in] | length | Length of the data in bytes, or 0 for none |
Implements RakNet::RakPeerInterface.
| virtual void RakNet::RakPeer::SetPerConnectionOutgoingBandwidthLimit | ( | unsigned | maxBitsPerSecond | ) | [virtual] |
Limits how much outgoing bandwidth can be sent per-connection. This limit does not apply to the sum of all connections! Exceeding the limit queues up outgoing traffic
| [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 RakNet::RakPeerInterface.
| void RakNet::RakPeer::SetSplitMessageProgressInterval | ( | int | interval | ) | [virtual] |
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).
| [in] | interval | How many messages to use as an interval before a download progress notification is returned. |
Implements RakNet::RakPeerInterface.
| void RakNet::RakPeer::SetTimeoutTime | ( | RakNet::TimeMS | 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. Do not set different values for different computers that are connected to each other, or you won't be able to reconnect after ID_CONNECTION_LOST
| [in] | timeMS | Time, in MS |
| [in] | target | SystemAddress structure of the target system. Pass UNASSIGNED_SYSTEM_ADDRESS for all systems. |
Implements RakNet::RakPeerInterface.
| void RakNet::RakPeer::SetUnreliableTimeout | ( | RakNet::TimeMS | timeoutMS | ) | [virtual] |
| [in] | timeoutMS | How many ms to wait before simply not sending an unreliable message. |
Implements RakNet::RakPeerInterface.
| virtual void RakNet::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
| [in] | _userUpdateThreadPtr | C callback function |
| [in] | _userUpdateThreadData | Passed to C callback function |
Implements RakNet::RakPeerInterface.
| void RakNet::RakPeer::ShiftIncomingTimestamp | ( | unsigned char * | data, |
| const SystemAddress & | systemAddress | ||
| ) | const [protected] |
| [in] | data | Data in the incoming packet. |
| [in] | systemAddress | Sender of the incoming packet. |
| void RakNet::RakPeer::Shutdown | ( | unsigned int | blockDuration, |
| unsigned char | orderingChannel = 0, |
||
| PacketPriority | disconnectionNotificationPriority = LOW_PRIORITY |
||
| ) | [virtual] |
| [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 RakNet::RakPeerInterface.
| StartupResult RakNet::RakPeer::Startup | ( | unsigned short | maxConnections, |
| SocketDescriptor * | socketDescriptors, | ||
| unsigned | socketDescriptorCount, | ||
| int | threadPriority = -99999 |
||
| ) | [virtual] |
You must call this before calling Connect().
| [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 | The port to listen for connections on. On linux the system may be set up so thast ports under 1024 are restricted for everything but the root user. Use a higher port for maximum compatibility. |
| [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); such as for a server. For a client, it is usually OK to just pass SocketDescriptor(); However, on the XBOX be sure to use IPPROTO_VDP |
| [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. For Linux based systems, you MUST pass something reasonable based on the thread priorities for your application. |
Implements RakNet::RakPeerInterface.
| void RakNet::RakPeer::ValidateRemoteSystemLookup | ( | void | ) | const [protected] |
| virtual void RakNet::RakPeer::WriteOutOfBandHeader | ( | RakNet::BitStream * | bitStream | ) | [virtual] |
Implements RakNet::RakPeerInterface.
| void ProcessNetworkPacket | ( | const SystemAddress | systemAddress, |
| const char * | data, | ||
| const int | length, | ||
| RakPeer * | rakPeer, | ||
| RakNet::TimeUS | timeRead | ||
| ) | [friend] |
| void ProcessNetworkPacket | ( | const SystemAddress | systemAddress, |
| const char * | data, | ||
| const int | length, | ||
| RakPeer * | rakPeer, | ||
| RakNetSmartPtr< RakNetSocket > | rakNetSocket, | ||
| RakNet::TimeUS | timeRead | ||
| ) | [friend] |
| bool ProcessOfflineNetworkPacket | ( | SystemAddress | systemAddress, |
| const char * | data, | ||
| const int | length, | ||
| RakPeer * | rakPeer, | ||
| RakNetSmartPtr< RakNetSocket > | rakNetSocket, | ||
| bool * | isOfflineMessage, | ||
| RakNet::TimeUS | timeRead | ||
| ) | [friend] |
| void* RecvFromLoop | ( | void * | arguments | ) | [friend] |
| void* UDTConnect | ( | void * | arguments | ) | [friend] |
| void* UpdateNetworkLoop | ( | void * | arguments | ) | [friend] |
RemoteSystemStruct** RakNet::RakPeer::activeSystemList [protected] |
activeSystemList holds a list of pointers and is preallocated to be the same size as remoteSystemList. It is updated only by the network thread, but read by both threads When the isActive member of RemoteSystemStruct is set to true or false, that system is added to this list of pointers Threadsafe because RemoteSystemStruct is preallocated, and the list is only added to, not removed from
unsigned int RakNet::RakPeer::activeSystemListSize [protected] |
bool RakNet::RakPeer::allowInternalRouting [protected] |
DataStructures::List<BanStruct*> RakNet::RakPeer::banList [protected] |
SimpleMutex RakNet::RakPeer::banListMutex [protected] |
unsigned int RakNet::RakPeer::bytesReceivedPerSecond [protected] |
unsigned int RakNet::RakPeer::bytesSentPerSecond [protected] |
int RakNet::RakPeer::defaultMTUSize [protected] |
RakNet::TimeMS RakNet::RakPeer::defaultTimeoutTime [protected] |
volatile bool RakNet::RakPeer::endThreads [protected] |
SystemAddress RakNet::RakPeer::firstExternalID [protected] |
char RakNet::RakPeer::incomingPassword[256] [protected] |
unsigned char RakNet::RakPeer::incomingPasswordLength [protected] |
SimpleMutex RakNet::RakPeer::incomingQueueMutex [protected] |
SystemAddress RakNet::RakPeer::ipList[10] [protected] |
volatile bool RakNet::RakPeer::isMainLoopThreadActive [protected] |
RakNet::LocklessUint32_t RakNet::RakPeer::isRecvFromLoopThreadActive [protected] |
unsigned short RakNet::RakPeer::maximumIncomingConnections [protected] |
* unsigned short RakNet::RakPeer::maximumNumberOfPeers [protected] |
unsigned RakNet::RakPeer::maxOutgoingBPS [protected] |
RakNetGUID RakNet::RakPeer::myGuid [protected] |
bool RakNet::RakPeer::occasionalPing [protected] |
SimpleMutex RakNet::RakPeer::packetReturnMutex [protected] |
DataStructures::Queue<Packet*> RakNet::RakPeer::packetReturnQueue [protected] |
SignaledEvent RakNet::RakPeer::quitAndDataEvents [protected] |
SimpleMutex RakNet::RakPeer::rakPeerMutexes[NUMBER_OF_RAKPEER_MUTEXES] [protected] |
RemoteSystemStruct* RakNet::RakPeer::remoteSystemList [protected] |
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
RemoteSystemIndex** RakNet::RakPeer::remoteSystemLookup [protected] |
bool RakNet::RakPeer::replyFromTargetBroadcast [protected] |
RakNet::BitStream* RakNet::RakPeer::replyFromTargetBS [protected] |
SystemAddress RakNet::RakPeer::replyFromTargetPlayer [protected] |
SimpleMutex RakNet::RakPeer::securityExceptionMutex [protected] |
uint32_t RakNet::RakPeer::sendReceiptSerial [protected] |
SimpleMutex RakNet::RakPeer::sendReceiptSerialMutex [protected] |
int RakNet::RakPeer::splitMessageProgressInterval [protected] |
bool RakNet::RakPeer::trackFrequencyTable [protected] |
RakNet::TimeMS RakNet::RakPeer::unreliableTimeout [protected] |
bool RakNet::RakPeer::updateCycleIsRunning [protected] |
void* RakNet::RakPeer::userUpdateThreadData [protected] |
void(* RakNet::RakPeer::userUpdateThreadPtr)(RakPeerInterface *, void *) [protected] |
unsigned int RakNet::RakPeer::validationInteger [protected] |
Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.