# FullyConnectedMesh2 Class Reference
[FullyConnectedMesh]

`#include <FullyConnectedMesh2.h>`

Inheritance diagram for FullyConnectedMesh2:

List of all members.

## Public Member Functions
RakNetGUID | GetConnectedHost (void) const
RakNetGUID | GetHostSystem (void) const
virtual void | Update (void)
| Update is called every time a packet is checked for .
virtual PluginReceiveResult | OnReceive (Packet *packet)
virtual void | OnStartup (void)
| Called when RakPeer is initialized.
virtual void | OnAttach (void)
virtual void | OnShutdown (void)
| Called when RakPeer is shutdown.
virtual void | OnClosedConnection (SystemAddress systemAddress, RakNetGUID rakNetGUID, PI2_LostConnectionReason lostConnectionReason)
virtual void | OnNewConnection (SystemAddress systemAddress, RakNetGUID rakNetGUID, bool isIncoming)

## Detailed Description

Fully connected mesh plugin, revision 2 This will connect RakPeer to all connecting peers, and all peers the connecting peer knows about. It will also calculate which system has been running longest, to find out who should be host, if you need one system to act as a host

Precondition:
  You must also install the ConnectionGraph2 plugin

## Member Function Documentation

RakNetGUID FullyConnectedMesh2::GetConnectedHost | ( | void |  | ) | const

Returns:
  System address of whichever system is host. Will return UNASSIGNED_RAKNET_GUID if we are not connected to anyone, or if we are connected and are calculating the host

RakNetGUID FullyConnectedMesh2::GetHostSystem | ( | void |  | ) | const

Returns:
  System address of whichever system is host. Always returns something, even though it may be our own system.

void FullyConnectedMesh2::OnAttach | ( | void |  | ) | `[virtual]`

Called when the interface is attached

Parameters:

  `[in]` | peer | the instance of RakPeer that is calling Receive

Reimplemented from PluginInterface2.

void FullyConnectedMesh2::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.

void FullyConnectedMesh2::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.

PluginReceiveResult FullyConnectedMesh2::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.

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

- C:/RakNet/Source/FullyConnectedMesh2.h
- C:/RakNet/Source/FullyConnectedMesh2.cpp