Public Member Functions | Protected Attributes

RakNetTransport2 Class Reference
[RakNetTransport]

Use RakNetTransport if you need a secure connection between the client and the console server. More...

#include <RakNetTransport2.h>

Inherits TransportInterface, and PluginInterface2.

Collaboration diagram for RakNetTransport2:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 RakNetTransport2 ()
virtual ~RakNetTransport2 ()
bool Start (unsigned short port, bool serverMode)
void Stop (void)
 Stop the transport provider. You can clear memory and shutdown threads here.
void Send (SystemAddress systemAddress, const char *data,...)
void CloseConnection (SystemAddress systemAddress)
PacketReceive (void)
void DeallocatePacket (Packet *packet)
SystemAddress HasNewIncomingConnection (void)
SystemAddress HasLostConnection (void)
virtual CommandParserInterfaceGetCommandParser (void)
virtual PluginReceiveResult OnReceive (Packet *packet)
virtual void OnClosedConnection (SystemAddress systemAddress, RakNetGUID rakNetGUID, PI2_LostConnectionReason lostConnectionReason)
virtual void OnNewConnection (SystemAddress systemAddress, RakNetGUID rakNetGUID, bool isIncoming)

Protected Attributes

DataStructures::Queue
< SystemAddress
newConnections
DataStructures::Queue
< SystemAddress
lostConnections
DataStructures::Queue< Packet * > packetQueue

Detailed Description

Use RakNetTransport if you need a secure connection between the client and the console server.

RakNetTransport automatically initializes security for the system. Use the project CommandConsoleClient to connect To the ConsoleServer if you use RakNetTransport

Definition at line 34 of file RakNetTransport2.h.


Constructor & Destructor Documentation

RakNetTransport2::RakNetTransport2 (  ) 

Definition at line 15 of file RakNetTransport2.cpp.

RakNetTransport2::~RakNetTransport2 (  )  [virtual]

Definition at line 18 of file RakNetTransport2.cpp.

Here is the call graph for this function:


Member Function Documentation

void RakNetTransport2::CloseConnection ( SystemAddress  systemAddress  ) 

Disconnect systemAddress . The binary address and port defines the SystemAddress structure.

Parameters:
[in] systemAddress The player/address to disconnect

Definition at line 56 of file RakNetTransport2.cpp.

Here is the call graph for this function:

void RakNetTransport2::DeallocatePacket ( Packet packet  ) 

Deallocate the Packet structure returned by Receive

Parameters:
[in] The packet to deallocate

Definition at line 78 of file RakNetTransport2.cpp.

Here is the call graph for this function:

virtual CommandParserInterface* RakNetTransport2::GetCommandParser ( void   )  [inline, virtual]

Definition at line 80 of file RakNetTransport2.h.

SystemAddress RakNetTransport2::HasLostConnection ( void   ) 

If a system loses the connection, you should queue that event and return the systemAddress/address of that player in this function.

Returns:
The SystemAddress/address of the system

Definition at line 72 of file RakNetTransport2.cpp.

Here is the call graph for this function:

SystemAddress RakNetTransport2::HasNewIncomingConnection ( void   ) 

If a new system connects to you, you should queue that event and return the systemAddress/address of that player in this function.

Returns:
The SystemAddress/address of the system

Definition at line 66 of file RakNetTransport2.cpp.

Here is the call graph for this function:

void RakNetTransport2::OnClosedConnection ( 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] 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 PluginInterface2.

Definition at line 105 of file RakNetTransport2.cpp.

Here is the call graph for this function:

void RakNetTransport2::OnNewConnection ( 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 PluginInterface2.

Definition at line 111 of file RakNetTransport2.cpp.

Here is the call graph for this function:

PluginReceiveResult RakNetTransport2::OnReceive ( Packet packet  )  [virtual]

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 PluginInterface2.

Definition at line 83 of file RakNetTransport2.cpp.

Here is the call graph for this function:

Packet * RakNetTransport2::Receive ( void   ) 

Return a string. The string should be allocated and written to Packet::data . The byte length should be written to Packet::length . The player/address should be written to Packet::systemAddress If your transport protocol adds special formatting to the data stream you should parse it out before returning it in the packet and thus only return a string in Packet::data

Returns:
The packet structure containing the result of Receive, or 0 if no data is available

Definition at line 60 of file RakNetTransport2.cpp.

Here is the call graph for this function:

void RakNetTransport2::Send ( SystemAddress  systemAddress,
const char *  data,
  ... 
)

Send a null-terminated string to systemAddress If your transport method requires particular formatting of the outgoing data (e.g. you don't just send strings) you can do it here and parse it out in Receive().

Parameters:
[in] systemAddress The player to send the string to
[in] data format specifier - same as RAKNET_DEBUG_PRINTF
[in] ... format specification arguments - same as RAKNET_DEBUG_PRINTF

Definition at line 39 of file RakNetTransport2.cpp.

Here is the call graph for this function:

bool RakNetTransport2::Start ( unsigned short  port,
bool  serverMode 
)

Start the transport provider on the indicated port.

Parameters:
[in] port The port to start the transport provider on
[in] serverMode If true, you should allow incoming connections (I don't actually use this anywhere)
Returns:
Return true on success, false on failure.

Definition at line 22 of file RakNetTransport2.cpp.

void RakNetTransport2::Stop ( void   ) 

Stop the transport provider. You can clear memory and shutdown threads here.

Definition at line 28 of file RakNetTransport2.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 89 of file RakNetTransport2.h.

Definition at line 89 of file RakNetTransport2.h.

Definition at line 90 of file RakNetTransport2.h.


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