RakNet  4.0
Public Member Functions | List of all members
RakNet::NatTypeDetectionClient Class Reference

Client code for NatTypeDetection. More...

#include <NatTypeDetectionClient.h>

Inheritance diagram for RakNet::NatTypeDetectionClient:
RakNet::PluginInterface2

Public Member Functions

void DetectNATType (SystemAddress _serverAddress)
 
virtual void Update (void)
 Update is called every time a packet is checked for .
 
virtual PluginReceiveResult OnReceive (Packet *packet)
 
virtual void OnClosedConnection (const SystemAddress &systemAddress, RakNetGUID rakNetGUID, PI2_LostConnectionReason lostConnectionReason)
 
virtual void OnRakPeerShutdown (void)
 Called when RakPeer is shutdown.
 
virtual void OnDetach (void)
 Called when the interface is detached.
 
- Public Member Functions inherited from RakNet::PluginInterface2
virtual void OnAttach (void)
 Called when the interface is attached.
 
virtual void OnRakPeerStartup (void)
 Called when RakPeer is initialized.
 
virtual void OnNewConnection (const SystemAddress &systemAddress, RakNetGUID rakNetGUID, bool isIncoming)
 
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)
 

Detailed Description

Client code for NatTypeDetection.

See NatTypeDetectionServer.h for algorithm To use, just connect to the server, and call DetectNAT You will get back ID_NAT_TYPE_DETECTION_RESULT with one of the enumerated values of NATTypeDetectionResult found in NATTypeDetectionCommon.h See also http://www.jenkinssoftware.com/raknet/manual/natpunchthrough.html

See Also
NatPunchthroughClient
NatTypeDetectionServer

Member Function Documentation

void RakNet::NatTypeDetectionClient::DetectNATType ( SystemAddress  _serverAddress)

Send the message to the server to detect the nat type Server must be running NatTypeDetectionServer We must already be connected to the server

Parameters
[in]serverAddressaddress of the server
virtual void RakNet::NatTypeDetectionClient::OnClosedConnection ( const SystemAddress systemAddress,
RakNetGUID  rakNetGUID,
PI2_LostConnectionReason  lostConnectionReason 
)
virtual

Called when a connection is dropped because the user called RakPeer::CloseConnection() for a particular system

Parameters
[in]systemAddressThe system whose connection was closed
[in]rakNetGuidThe guid of the specified system
[in]lostConnectionReasonHow the connection was closed: manually, connection lost, or notification of disconnection

Reimplemented from RakNet::PluginInterface2.

virtual PluginReceiveResult RakNet::NatTypeDetectionClient::OnReceive ( Packet packet)
virtual

OnReceive is called for every packet.

Parameters
[in]packetthe 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.


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