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

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

#include <RakNetTransport2.h>

Inheritance diagram for RakNet::RakNetTransport2:

List of all members.

Public Member Functions

void CloseConnection (SystemAddress systemAddress)
void DeallocatePacket (Packet *packet)
virtual CommandParserInterfaceGetCommandParser (void)
SystemAddress HasLostConnection (void)
SystemAddress HasNewIncomingConnection (void)
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)
 RakNetTransport2 ()
PacketReceive (void)
void Send (SystemAddress systemAddress, const char *data,...)
bool Start (unsigned short port, bool serverMode)
void Stop (void)
 Stop the transport provider. You can clear memory and shutdown threads here.
virtual ~RakNetTransport2 ()

Static Public Member Functions

static void DestroyInstance (RakNetTransport2 *i)
static RakNetTransport2GetInstance (void)

Protected Attributes

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

Detailed Description

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

Definition at line 36 of file RakNetTransport2.h.


Constructor & Destructor Documentation

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

Member Function Documentation

void RakNet::RakNetTransport2::CloseConnection ( SystemAddress  systemAddress) [virtual]

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

Parameters:
[in]systemAddressThe player/address to disconnect

Implements RakNet::TransportInterface.

void RakNet::RakNetTransport2::DeallocatePacket ( Packet packet) [virtual]

Deallocate the Packet structure returned by Receive

Parameters:
[in]Thepacket to deallocate

Implements RakNet::TransportInterface.

static void RakNet::RakNetTransport2::DestroyInstance ( RakNetTransport2 i) [static]
virtual CommandParserInterface* RakNet::RakNetTransport2::GetCommandParser ( void  ) [inline, virtual]

Your transport provider can itself have command parsers if the transport layer has user-modifiable features For example, your transport layer may have a password which you want remote users to be able to set or you may want to allow remote users to turn on or off command echo

Returns:
0 if you do not need a command parser - otherwise the desired derivation of CommandParserInterface

Implements RakNet::TransportInterface.

Definition at line 85 of file RakNetTransport2.h.

{return 0;}
static RakNetTransport2* RakNet::RakNetTransport2::GetInstance ( void  ) [static]
SystemAddress RakNet::RakNetTransport2::HasLostConnection ( void  ) [virtual]

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

Implements RakNet::TransportInterface.

SystemAddress RakNet::RakNetTransport2::HasNewIncomingConnection ( void  ) [virtual]

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

Implements RakNet::TransportInterface.

virtual void RakNet::RakNetTransport2::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 void RakNet::RakNetTransport2::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::RakNetTransport2::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.

Packet* RakNet::RakNetTransport2::Receive ( void  ) [virtual]

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

Implements RakNet::TransportInterface.

void RakNet::RakNetTransport2::Send ( SystemAddress  systemAddress,
const char *  data,
  ... 
) [virtual]

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]systemAddressThe player to send the string to
[in]dataformat specifier - same as RAKNET_DEBUG_PRINTF
[in]...format specification arguments - same as RAKNET_DEBUG_PRINTF

Implements RakNet::TransportInterface.

bool RakNet::RakNetTransport2::Start ( unsigned short  port,
bool  serverMode 
) [virtual]

Start the transport provider on the indicated port.

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

Implements RakNet::TransportInterface.

void RakNet::RakNetTransport2::Stop ( void  ) [virtual]

Member Data Documentation

Definition at line 94 of file RakNetTransport2.h.

Definition at line 94 of file RakNetTransport2.h.

Definition at line 95 of file RakNetTransport2.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