Client code for NATPunchthrough.
More...
#include <NatPunchthroughClient.h>
|
bool | OpenNAT (RakNetGUID destination, const SystemAddress &facilitator) |
|
PunchthroughConfiguration * | GetPunchthroughConfiguration (void) |
|
void | SetDebugInterface (NatPunchthroughDebugInterface *i) |
|
void | GetUPNPPortMappings (char *externalPort, char *internalPort, const SystemAddress &natPunchthroughServerAddress) |
| Get the port mappings you should pass to UPNP (for miniupnpc-1.6.20120410, for the function UPNP_AddPortMapping)
|
|
virtual void | Update (void) |
| Update is called every time a packet is checked for .
|
|
virtual PluginReceiveResult | OnReceive (Packet *packet) |
|
virtual void | OnNewConnection (const SystemAddress &systemAddress, RakNetGUID rakNetGUID, bool isIncoming) |
|
virtual void | OnClosedConnection (const SystemAddress &systemAddress, RakNetGUID rakNetGUID, PI2_LostConnectionReason lostConnectionReason) |
|
virtual void | OnAttach (void) |
| Called when the interface is attached.
|
|
virtual void | OnDetach (void) |
| Called when the interface is detached.
|
|
virtual void | OnRakPeerShutdown (void) |
| Called when RakPeer is shutdown.
|
|
virtual void | OnRakPeerStartup (void) |
| Called when RakPeer is initialized.
|
|
virtual void | OnFailedConnectionAttempt (Packet *packet, PI2_FailedConnectionAttemptReason failedConnectionAttemptReason) |
|
virtual bool | UsesReliabilityLayer (void) const |
|
virtual void | OnDirectSocketSend (const char *data, const BitSize_t bitsUsed, SystemAddress remoteSystemAddress) |
|
virtual void | OnDirectSocketReceive (const char *data, const BitSize_t bitsUsed, SystemAddress remoteSystemAddress) |
|
virtual void | OnReliabilityLayerNotification (const char *errorMessage, const BitSize_t bitsUsed, SystemAddress remoteSystemAddress, bool isError) |
|
virtual void | OnInternalPacket (InternalPacket *internalPacket, unsigned frameNumber, SystemAddress remoteSystemAddress, RakNet::TimeMS time, int isSend) |
|
virtual void | OnAck (unsigned int messageNumber, SystemAddress remoteSystemAddress, RakNet::TimeMS time) |
|
virtual void | OnPushBackPacket (const char *data, const BitSize_t bitsUsed, SystemAddress remoteSystemAddress) |
|
Client code for NATPunchthrough.
Maintain connection to NatPunchthroughServer to process incoming connection attempts through NatPunchthroughClient
Client will send datagrams to port to estimate next port
Will simultaneously connect with another client once ports are estimated.
- See Also
- NatTypeDetectionClient See also http://www.jenkinssoftware.com/raknet/manual/natpunchthrough.html
PunchthroughConfiguration* RakNet::NatPunchthroughClient::GetPunchthroughConfiguration |
( |
void |
| ) |
|
Modify the system configuration if desired Don't modify the variables in the structure while punchthrough is in progress
Called when a connection is dropped because the user called RakPeer::CloseConnection() for a particular system
- Parameters
-
[in] | systemAddress | The system whose connection was closed |
[in] | rakNetGuid | The guid of the specified system |
[in] | lostConnectionReason | How the connection was closed: manually, connection lost, or notification of disconnection |
Reimplemented from RakNet::PluginInterface2.
virtual void RakNet::NatPunchthroughClient::OnNewConnection |
( |
const SystemAddress & |
systemAddress, |
|
|
RakNetGUID |
rakNetGUID, |
|
|
bool |
isIncoming |
|
) |
| |
|
virtual |
Called when we got a new connection
- Parameters
-
[in] | systemAddress | Address of the new connection |
[in] | rakNetGuid | The guid of the specified system |
[in] | isIncoming | If true, this is ID_NEW_INCOMING_CONNECTION, or the equivalent |
Reimplemented from RakNet::PluginInterface2.
OnReceive is called for every packet.
- Parameters
-
[in] | packet | the packet that is being returned to the user |
- Returns
- True to allow the game and other plugins to get this message, false to absorb it
Reimplemented from RakNet::PluginInterface2.
void RakNet::NatPunchthroughClient::SetDebugInterface |
( |
NatPunchthroughDebugInterface * |
i | ) |
|
Sets a callback to be called with debug messages
- Parameters
-
[in] | i | Pointer to an interface. The pointer is stored, so don't delete it while in progress. Pass 0 to clear. |
The documentation for this class was generated from the following file: