Shadowrun: Awakened 29 September 2011 - Build 871
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes
RakNet::NatPunchthroughServer Class Reference

Server code for NATPunchthrough. More...

#include <NatPunchthroughServer.h>

Inheritance diagram for RakNet::NatPunchthroughServer:

List of all members.

Classes

struct  ConnectionAttempt
struct  User

Public Member Functions

 NatPunchthroughServer ()
virtual void OnClosedConnection (const SystemAddress &systemAddress, RakNetGUID rakNetGUID, PI2_LostConnectionReason lostConnectionReason)
virtual void OnNewConnection (const SystemAddress &systemAddress, RakNetGUID rakNetGUID, bool isIncoming)
virtual PluginReceiveResult OnReceive (Packet *packet)
void SetDebugInterface (NatPunchthroughServerDebugInterface *i)
virtual void Update (void)
 Update is called every time a packet is checked for .
virtual ~NatPunchthroughServer ()

Static Public Member Functions

static void DestroyInstance (NatPunchthroughServer *i)
static NatPunchthroughServerGetInstance (void)
static int NatPunchthroughUserComp (const RakNetGUID &key, User *const &data)

Public Attributes

RakNet::Time lastUpdate

Protected Member Functions

void OnClientReady (Packet *packet)
void OnGetMostRecentPort (Packet *packet)
void OnNATPunchthroughRequest (Packet *packet)
void SendTimestamps (void)
void StartPendingPunchthrough (void)
void StartPunchthroughForUser (User *user)

Protected Attributes

NatPunchthroughServerDebugInterfacenatPunchthroughServerDebugInterface
uint16_t sessionId
DataStructures::OrderedList
< RakNetGUID, User
*, NatPunchthroughServer::NatPunchthroughUserComp > 
users

Detailed Description

Maintain connection to NatPunchthroughServer to process incoming connection attempts through NatPunchthroughClient
Server maintains two sockets clients can connect to so as to estimate the next port choice
Server tells other client about port estimate, current public port to the server, and a time to start connection attempts

See also:
NatTypeDetectionClient See also http://www.jenkinssoftware.com/raknet/manual/natpunchthrough.html

Definition at line 70 of file NatPunchthroughServer.h.


Constructor & Destructor Documentation

RakNet::NatPunchthroughServer::NatPunchthroughServer ( )
virtual RakNet::NatPunchthroughServer::~NatPunchthroughServer ( ) [virtual]

Member Function Documentation

static void RakNet::NatPunchthroughServer::DestroyInstance ( NatPunchthroughServer i) [static]
static NatPunchthroughServer* RakNet::NatPunchthroughServer::GetInstance ( void  ) [static]
static int RakNet::NatPunchthroughServer::NatPunchthroughUserComp ( const RakNetGUID key,
User *const &  data 
) [static]
void RakNet::NatPunchthroughServer::OnClientReady ( Packet packet) [protected]
virtual void RakNet::NatPunchthroughServer::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.

void RakNet::NatPunchthroughServer::OnGetMostRecentPort ( Packet packet) [protected]
void RakNet::NatPunchthroughServer::OnNATPunchthroughRequest ( Packet packet) [protected]
virtual void RakNet::NatPunchthroughServer::OnNewConnection ( const SystemAddress systemAddress,
RakNetGUID  rakNetGUID,
bool  isIncoming 
) [virtual]

Called when we got a new connection

Parameters:
[in]systemAddressAddress of the new connection
[in]rakNetGuidThe guid of the specified system
[in]isIncomingIf true, this is ID_NEW_INCOMING_CONNECTION, or the equivalent

Reimplemented from RakNet::PluginInterface2.

virtual PluginReceiveResult RakNet::NatPunchthroughServer::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.

void RakNet::NatPunchthroughServer::SendTimestamps ( void  ) [protected]
void RakNet::NatPunchthroughServer::SetDebugInterface ( NatPunchthroughServerDebugInterface i)

Sets a callback to be called with debug messages

Parameters:
[in]iPointer to an interface. The pointer is stored, so don't delete it while in progress. Pass 0 to clear.
void RakNet::NatPunchthroughServer::StartPendingPunchthrough ( void  ) [protected]
void RakNet::NatPunchthroughServer::StartPunchthroughForUser ( User user) [protected]
virtual void RakNet::NatPunchthroughServer::Update ( void  ) [virtual]

Reimplemented from RakNet::PluginInterface2.


Member Data Documentation

Definition at line 124 of file NatPunchthroughServer.h.

Definition at line 137 of file NatPunchthroughServer.h.

Definition at line 136 of file NatPunchthroughServer.h.

DataStructures::OrderedList<RakNetGUID, User*, NatPunchthroughServer::NatPunchthroughUserComp> RakNet::NatPunchthroughServer::users [protected]

Definition at line 128 of file NatPunchthroughServer.h.


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

Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.

GNU Lesser General Public License 3 Sourceforge.net