Classes |
| struct | ConnectionRequestSystem |
| struct | ConnnectRequest |
| struct | ForwardedConnection |
| struct | MiniPunchRequest |
Public Types |
| enum | Router2RequestStates { R2RS_REQUEST_STATE_QUERY_FORWARDING,
REQUEST_STATE_REQUEST_FORWARDING
} |
Public Member Functions |
| void | EstablishRouting (RakNetGUID endpointGuid) |
| | Query all connected systems to connect through them to a third system. System will return ID_ROUTER_2_FORWARDING_NO_PATH if unable to connect. Else you will get ID_ROUTER_2_FORWARDING_ESTABLISHED.
|
| unsigned int | GetConnectionRequestIndex (RakNetGUID endpointGuid) |
| Router2DebugInterface * | GetDebugInterface (void) const |
| | Get the pointer passed to SetDebugInterface()
|
| virtual void | OnClosedConnection (const SystemAddress &systemAddress, RakNetGUID rakNetGUID, PI2_LostConnectionReason lostConnectionReason) |
| virtual void | OnFailedConnectionAttempt (Packet *packet, PI2_FailedConnectionAttemptReason failedConnectionAttemptReason) |
| virtual void | OnRakPeerShutdown (void) |
| | Called when RakPeer is shutdown.
|
| virtual PluginReceiveResult | OnReceive (Packet *packet) |
| | Router2 () |
| void | SetDebugInterface (Router2DebugInterface *_debugInterface) |
| | For testing and debugging.
|
| void | SetMaximumForwardingRequests (int max) |
| void | SetSocketFamily (unsigned short _socketFamily) |
| virtual void | Update (void) |
| | Update is called every time a packet is checked for .
|
| virtual | ~Router2 () |
Static Public Member Functions |
| static void | DestroyInstance (Router2 *i) |
| static Router2 * | GetInstance (void) |
Protected Member Functions |
| void | ClearAll (void) |
| void | ClearConnectionRequests (void) |
| void | ClearForwardedConnections (void) |
| void | ClearMinipunches (void) |
| bool | ConnectInternal (RakNetGUID endpointGuid, bool returnConnectionLostOnFailure) |
| int | GetLargestPingAmongConnectedSystems (void) const |
| bool | OnForwardingSuccess (Packet *packet) |
| void | OnMiniPunchReply (Packet *packet) |
| void | OnMiniPunchReplyBounce (Packet *packet) |
| void | OnQueryForwarding (Packet *packet) |
| void | OnQueryForwardingReply (Packet *packet) |
| void | OnRequestForwarding (Packet *packet) |
| void | OnRerouted (Packet *packet) |
| void | RemoveConnectionRequest (unsigned int connectionRequestIndex) |
| void | RequestForwarding (ConnnectRequest *connectionRequest) |
| int | ReturnFailureOnCannotForward (RakNetGUID sourceGuid, RakNetGUID endpointGuid) |
| void | ReturnToUser (MessageID messageId, RakNetGUID endpointGuid, const SystemAddress &systemAddress, bool wasGeneratedLocally) |
| void | SendFailureOnCannotForward (RakNetGUID sourceGuid, RakNetGUID endpointGuid) |
| void | SendForwardingSuccess (MessageID messageId, RakNetGUID sourceGuid, RakNetGUID endpointGuid, unsigned short sourceToDstPort) |
| void | SendOOBFromRakNetPort (OutOfBandIdentifiers oob, BitStream *extraData, SystemAddress sa) |
| void | SendOOBFromSpecifiedSocket (OutOfBandIdentifiers oob, SystemAddress sa, SOCKET socket) |
| void | SendOOBMessages (MiniPunchRequest *mpr) |
| bool | UpdateForwarding (ConnnectRequest *connectionRequest) |
Protected Attributes |
DataStructures::List
< ConnnectRequest * > | connectionRequests |
| SimpleMutex | connectionRequestsMutex |
| Router2DebugInterface * | debugInterface |
DataStructures::List
< ForwardedConnection > | forwardedConnectionList |
| SimpleMutex | forwardedConnectionListMutex |
| int | maximumForwardingRequests |
DataStructures::List
< MiniPunchRequest > | miniPunchesInProgress |
| SimpleMutex | miniPunchesInProgressMutex |
| unsigned short | socketFamily |
| UDPForwarder * | udpForwarder |
Definition at line 46 of file Router2.h.
| void RakNet::Router2::EstablishRouting |
( |
RakNetGUID |
endpointGuid | ) |
|
On ID_ROUTER_2_FORWARDING_ESTABLISHED, EstablishRouting as follows:
RakNet::BitStream bs(packet->data, packet->length, false); bs.IgnoreBytes(sizeof(MessageID)); RakNetGUID endpointGuid; bs.Read(endpointGuid); unsigned short sourceToDestPort; bs.Read(sourceToDestPort); char ipAddressString[32]; packet->systemAddress.ToString(false, ipAddressString); rakPeerInterface->EstablishRouting(ipAddressString, sourceToDestPort, 0,0);
- Note:
- The SystemAddress for a connection should not be used - always use RakNetGuid as the address can change at any time. When the address changes, you will get ID_ROUTER_2_REROUTED