A one hop connection graph. More...
#include <ConnectionGraph2.h>
Inherits PluginInterface2.
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 |
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.
bool ConnectionGraph2::ConnectionExists | ( | RakNetGUID | g1, | |
RakNetGUID | g2 | |||
) |
Returns if g1 is connected to g2.
Definition at line 55 of file ConnectionGraph2.cpp.
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.
[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 |
Definition at line 27 of file ConnectionGraph2.cpp.
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
[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.
void ConnectionGraph2::OnNewConnection | ( | SystemAddress | systemAddress, | |
RakNetGUID | rakNetGUID, | |||
bool | isIncoming | |||
) | [protected, virtual] |
Called when we got a new connection
[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.
PluginReceiveResult ConnectionGraph2::OnReceive | ( | Packet * | packet | ) | [protected, virtual] |
OnReceive is called for every packet.
[in] | packet | the packet that is being returned to the user |
Reimplemented from PluginInterface2.
Definition at line 141 of file ConnectionGraph2.cpp.
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.
DataStructures::OrderedList<RakNetGUID, RemoteSystem*, ConnectionGraph2::RemoteSystemComp> ConnectionGraph2::remoteSystems [protected] |
Definition at line 70 of file ConnectionGraph2.h.