Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

ConnectionGraph2 Class Reference
[ConnectionGraph]

A one hop connection graph. More...

#include <ConnectionGraph2.h>

Inherits PluginInterface2.

Collaboration diagram for ConnectionGraph2:
Collaboration graph
[legend]

List of all members.

Classes

struct  RemoteSystem
struct  SystemAddressAndGuid

Public Member Functions

bool GetConnectionListForRemoteSystem (RakNetGUID remoteSystemGuid, SystemAddress *saOut, RakNetGUID *guidOut, unsigned int *outLength)
 Given a remote system identified by RakNetGUID, return the list of SystemAddresses and RakNetGUIDs they are connected to.
bool ConnectionExists (RakNetGUID g1, RakNetGUID g2)
 Returns if g1 is connected to g2.

Static Public Member Functions

static int SystemAddressAndGuidComp (const SystemAddressAndGuid &key, const SystemAddressAndGuid &data)
static int RemoteSystemComp (const RakNetGUID &key, RemoteSystem *const &data)

Protected Member Functions

virtual void OnClosedConnection (SystemAddress systemAddress, RakNetGUID rakNetGUID, PI2_LostConnectionReason lostConnectionReason)
virtual void OnNewConnection (SystemAddress systemAddress, RakNetGUID rakNetGUID, bool isIncoming)
virtual PluginReceiveResult OnReceive (Packet *packet)

Protected Attributes

DataStructures::OrderedList
< RakNetGUID, RemoteSystem
*, ConnectionGraph2::RemoteSystemComp > 
remoteSystems

Detailed Description

A one hop connection graph.

Sends ID_CONNECTION_GRAPH_DISCONNECTION_NOTIFICATION, ID_CONNECTION_GRAPH_CONNECTION_LOST, ID_CONNECTION_GRAPH_NEW_CONNECTION
All identifiers are followed by SystemAddress, then RakNetGUID Also stores the list for you, which you can access with GetConnectionListForRemoteSystem

Definition at line 28 of file ConnectionGraph2.h.


Member Function Documentation

bool ConnectionGraph2::ConnectionExists ( RakNetGUID  g1,
RakNetGUID  g2 
)

Returns if g1 is connected to g2.

Definition at line 55 of file ConnectionGraph2.cpp.

Here is the call graph for this function:

bool ConnectionGraph2::GetConnectionListForRemoteSystem ( RakNetGUID  remoteSystemGuid,
SystemAddress saOut,
RakNetGUID guidOut,
unsigned int *  outLength 
)

Given a remote system identified by RakNetGUID, return the list of SystemAddresses and RakNetGUIDs they are connected to.

Parameters:
[in] remoteSystemGuid Which system we are referring to. This only works for remote systems, not ourselves.
[out] saOut A preallocated array to hold the output list of SystemAddress. Can be 0 if you don't care.
[out] guidOut A preallocated array to hold the output list of RakNetGUID. Can be 0 if you don't care.
[in,out] outLength On input, the size of saOut and guidOut. On output, modified to reflect the number of elements actually written
Returns:
True if remoteSystemGuid was found. Otherwise false, and saOut, guidOut remain unchanged. outLength will be set to 0.

Definition at line 27 of file ConnectionGraph2.cpp.

Here is the call graph for this function:

void ConnectionGraph2::OnClosedConnection ( SystemAddress  systemAddress,
RakNetGUID  rakNetGUID,
PI2_LostConnectionReason  lostConnectionReason 
) [protected, 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 70 of file ConnectionGraph2.cpp.

Here is the call graph for this function:

void ConnectionGraph2::OnNewConnection ( SystemAddress  systemAddress,
RakNetGUID  rakNetGUID,
bool  isIncoming 
) [protected, 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 90 of file ConnectionGraph2.cpp.

Here is the call graph for this function:

PluginReceiveResult ConnectionGraph2::OnReceive ( Packet packet  )  [protected, 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 141 of file ConnectionGraph2.cpp.

Here is the call graph for this function:

int ConnectionGraph2::RemoteSystemComp ( const RakNetGUID key,
RemoteSystem *const &  data 
) [static]

Definition at line 9 of file ConnectionGraph2.cpp.

int ConnectionGraph2::SystemAddressAndGuidComp ( const SystemAddressAndGuid key,
const SystemAddressAndGuid data 
) [static]

Definition at line 18 of file ConnectionGraph2.cpp.


Member Data Documentation

DataStructures::OrderedList<RakNetGUID, RemoteSystem*, ConnectionGraph2::RemoteSystemComp> ConnectionGraph2::remoteSystems [protected]

Definition at line 70 of file ConnectionGraph2.h.


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