![]() |
Shadowrun: Awakened 29 September 2011 - Build 871
|
Fully connected mesh plugin, revision 2. More...
#include <FullyConnectedMesh2.h>
Inheritance diagram for RakNet::FullyConnectedMesh2:Classes | |
| struct | FCM2Participant |
Public Member Functions | |
| void | AddParticipant (RakNetGUID rakNetGuid) |
| if SetAutoparticipateConnections() is called with false, then you need to use AddParticipant before these systems will be added to the mesh FullyConnectedMesh2 will track who is the who host among a fully connected mesh of participants Each remote system that you want to check should be added as a participant, either through SetAutoparticipateConnections() or by calling this function | |
| void | Clear (void) |
| Clear all memory and reset everything. | |
| void | ConnectToRemoteNewIncomingConnections (Packet *packet) |
| FullyConnectedMesh2 () | |
| RakNetGUID | GetConnectedHost (void) const |
| The connected host is whichever system we are connected to that has been running the longest. | |
| SystemAddress | GetConnectedHostAddr (void) const |
| RakNet::TimeUS | GetElapsedRuntime (void) |
| void | GetHostOrder (DataStructures::List< RakNetGUID > &hostList) |
| RakNetGUID | GetHostSystem (void) const |
| unsigned int | GetParticipantCount (void) const |
| void | GetParticipantCount (DataStructures::DefaultIndexType *participantListSize) const |
| void | GetParticipantList (DataStructures::List< RakNetGUID > &participantList) |
| unsigned int | GetTotalConnectionCount (void) const |
| bool | IsConnectedHost (void) const |
| bool | IsHostSystem (void) const |
| virtual void | OnAttach (void) |
| Called when the interface is attached. | |
| virtual void | OnClosedConnection (const SystemAddress &systemAddress, RakNetGUID rakNetGUID, PI2_LostConnectionReason lostConnectionReason) |
| virtual void | OnNewConnection (const SystemAddress &systemAddress, RakNetGUID rakNetGUID, bool isIncoming) |
| virtual void | OnRakPeerShutdown (void) |
| Called when RakPeer is shutdown. | |
| virtual void | OnRakPeerStartup (void) |
| Called when RakPeer is initialized. | |
| virtual PluginReceiveResult | OnReceive (Packet *packet) |
| void | ResetHostCalculation (void) |
| void | SetAutoparticipateConnections (bool b) |
| Automatically add new connections to the fully connected mesh. Each remote system that you want to check should be added as a participant, either through SetAutoparticipateConnections() or by calling this function. | |
| void | SetConnectOnNewRemoteConnection (bool attemptConnection, RakNet::RakString pw) |
| virtual | ~FullyConnectedMesh2 () |
Static Public Member Functions | |
| static void | DestroyInstance (FullyConnectedMesh2 *i) |
| static FullyConnectedMesh2 * | GetInstance (void) |
Protected Member Functions | |
| bool | AddParticipantInternal (RakNetGUID rakNetGuid, FCM2Guid theirFCMGuid) |
| void | AssignOurFCMGuid (void) |
| void | CalculateAndPushHost (void) |
| void | CalculateHost (RakNetGUID *rakNetGuid, FCM2Guid *fcm2Guid) |
| void | IncrementTotalConnectionCount (unsigned int i) |
| void | OnInformFCMGuid (Packet *packet) |
| void | OnRequestFCMGuid (Packet *packet) |
| void | OnRespondConnectionCount (Packet *packet) |
| void | OnUpdateMinTotalConnectionCount (Packet *packet) |
| bool | ParticipantListComplete (void) |
| void | PushNewHost (const RakNetGUID &guid, RakNetGUID oldHost) |
| void | SendConnectionCountResponse (SystemAddress addr, unsigned int responseTotalConnectionCount) |
| void | SendFCMGuidRequest (RakNetGUID rakNetGuid) |
| void | SendOurFCMGuid (SystemAddress addr) |
Protected Attributes | |
| bool | autoParticipateConnections |
| RakNet::RakString | connectionPassword |
| bool | connectOnNewRemoteConnections |
| DataStructures::List < FCM2Participant > | fcm2ParticipantList |
| List of systems we know the FCM2Guid for. | |
| FCM2Guid | hostFCM2Guid |
| RakNetGUID | hostRakNetGuid |
| RakNetGUID | lastPushedHost |
| FCM2Guid | ourFCMGuid |
| RakNet::TimeUS | startupTime |
| unsigned int | totalConnectionCount |
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
Definition at line 34 of file FullyConnectedMesh2.h.
| RakNet::FullyConnectedMesh2::FullyConnectedMesh2 | ( | ) |
| virtual RakNet::FullyConnectedMesh2::~FullyConnectedMesh2 | ( | ) | [virtual] |
| void RakNet::FullyConnectedMesh2::AddParticipant | ( | RakNetGUID | rakNetGuid | ) |
| [in] | participant | The new participant |
| bool RakNet::FullyConnectedMesh2::AddParticipantInternal | ( | RakNetGUID | rakNetGuid, |
| FCM2Guid | theirFCMGuid | ||
| ) | [protected] |
| void RakNet::FullyConnectedMesh2::AssignOurFCMGuid | ( | void | ) | [protected] |
| void RakNet::FullyConnectedMesh2::CalculateAndPushHost | ( | void | ) | [protected] |
| void RakNet::FullyConnectedMesh2::CalculateHost | ( | RakNetGUID * | rakNetGuid, |
| FCM2Guid * | fcm2Guid | ||
| ) | [protected] |
| void RakNet::FullyConnectedMesh2::Clear | ( | void | ) |
| void RakNet::FullyConnectedMesh2::ConnectToRemoteNewIncomingConnections | ( | Packet * | packet | ) |
Connect to all systems from ID_REMOTE_NEW_INCOMING_CONNECTION You can call this if SetConnectOnNewRemoteConnection is false
| [in] | packet | The packet containing ID_REMOTE_NEW_INCOMING_CONNECTION |
| [in] | connectionPassword | Password passed to RakPeerInterface::Connect() |
| [in] | connectionPasswordLength | Password length passed to RakPeerInterface::Connect() |
| static void RakNet::FullyConnectedMesh2::DestroyInstance | ( | FullyConnectedMesh2 * | i | ) | [static] |
| RakNetGUID RakNet::FullyConnectedMesh2::GetConnectedHost | ( | void | ) | const |
Will return UNASSIGNED_RAKNET_GUID if we are not connected to anyone, or if we are connected and are calculating the host If includeCalculating is true, will return the estimated calculated host as long as the calculation is nearly complete includeCalculating should be true if you are taking action based on another system becoming host, because not all host calculations may complete at the exact same time
| SystemAddress RakNet::FullyConnectedMesh2::GetConnectedHostAddr | ( | void | ) | const |
| RakNet::TimeUS RakNet::FullyConnectedMesh2::GetElapsedRuntime | ( | void | ) |
| void RakNet::FullyConnectedMesh2::GetHostOrder | ( | DataStructures::List< RakNetGUID > & | hostList | ) |
Get the list of connected systems, from oldest connected to newest This is also the order that the hosts will be chosen in
| RakNetGUID RakNet::FullyConnectedMesh2::GetHostSystem | ( | void | ) | const |
| static FullyConnectedMesh2* RakNet::FullyConnectedMesh2::GetInstance | ( | void | ) | [static] |
| unsigned int RakNet::FullyConnectedMesh2::GetParticipantCount | ( | void | ) | const |
| void RakNet::FullyConnectedMesh2::GetParticipantCount | ( | DataStructures::DefaultIndexType * | participantListSize | ) | const |
| void RakNet::FullyConnectedMesh2::GetParticipantList | ( | DataStructures::List< RakNetGUID > & | participantList | ) |
Get the participants added with AddParticipant()
| [out] | participantList | Participants added with AddParticipant(); |
| unsigned int RakNet::FullyConnectedMesh2::GetTotalConnectionCount | ( | void | ) | const |
| void RakNet::FullyConnectedMesh2::IncrementTotalConnectionCount | ( | unsigned int | i | ) | [protected] |
| bool RakNet::FullyConnectedMesh2::IsConnectedHost | ( | void | ) | const |
| [in] | includeCalculating | If true, and we are currently calculating a new host, return the new host if the calculation is nearly complete |
| bool RakNet::FullyConnectedMesh2::IsHostSystem | ( | void | ) | const |
| virtual void RakNet::FullyConnectedMesh2::OnAttach | ( | void | ) | [virtual] |
Reimplemented from RakNet::PluginInterface2.
| virtual void RakNet::FullyConnectedMesh2::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
| [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 RakNet::PluginInterface2.
| void RakNet::FullyConnectedMesh2::OnInformFCMGuid | ( | Packet * | packet | ) | [protected] |
| virtual void RakNet::FullyConnectedMesh2::OnNewConnection | ( | const SystemAddress & | systemAddress, |
| RakNetGUID | rakNetGUID, | ||
| bool | isIncoming | ||
| ) | [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 RakNet::PluginInterface2.
| virtual void RakNet::FullyConnectedMesh2::OnRakPeerShutdown | ( | void | ) | [virtual] |
Reimplemented from RakNet::PluginInterface2.
| virtual void RakNet::FullyConnectedMesh2::OnRakPeerStartup | ( | void | ) | [virtual] |
Reimplemented from RakNet::PluginInterface2.
| virtual PluginReceiveResult RakNet::FullyConnectedMesh2::OnReceive | ( | Packet * | packet | ) | [virtual] |
OnReceive is called for every packet.
| [in] | packet | the packet that is being returned to the user |
Reimplemented from RakNet::PluginInterface2.
| void RakNet::FullyConnectedMesh2::OnRequestFCMGuid | ( | Packet * | packet | ) | [protected] |
| void RakNet::FullyConnectedMesh2::OnRespondConnectionCount | ( | Packet * | packet | ) | [protected] |
| void RakNet::FullyConnectedMesh2::OnUpdateMinTotalConnectionCount | ( | Packet * | packet | ) | [protected] |
| bool RakNet::FullyConnectedMesh2::ParticipantListComplete | ( | void | ) | [protected] |
| void RakNet::FullyConnectedMesh2::PushNewHost | ( | const RakNetGUID & | guid, |
| RakNetGUID | oldHost | ||
| ) | [protected] |
| void RakNet::FullyConnectedMesh2::ResetHostCalculation | ( | void | ) |
Clear our own host order, and recalculate as if we had just reconnected Call this to reset the running time of the host just before joining/creating a game room for networking
| void RakNet::FullyConnectedMesh2::SendConnectionCountResponse | ( | SystemAddress | addr, |
| unsigned int | responseTotalConnectionCount | ||
| ) | [protected] |
| void RakNet::FullyConnectedMesh2::SendFCMGuidRequest | ( | RakNetGUID | rakNetGuid | ) | [protected] |
| void RakNet::FullyConnectedMesh2::SendOurFCMGuid | ( | SystemAddress | addr | ) | [protected] |
| void RakNet::FullyConnectedMesh2::SetAutoparticipateConnections | ( | bool | b | ) |
Defaults to true.
| [in] | b | As stated |
| void RakNet::FullyConnectedMesh2::SetConnectOnNewRemoteConnection | ( | bool | attemptConnection, |
| RakNet::RakString | pw | ||
| ) |
When the message ID_REMOTE_NEW_INCOMING_CONNECTION arrives, we try to connect to that system If attemptConnection is false, you can manually connect to all systems listed in ID_REMOTE_NEW_INCOMING_CONNECTION with ConnectToRemoteNewIncomingConnections()
| [in] | attemptConnection | If true, we try to connect to any systems we are notified about with ID_REMOTE_NEW_INCOMING_CONNECTION, which comes from the ConnectionGraph2 plugin. Defaults to true. |
| [in] | pw | The password to use to connect with. Only used if attemptConnection is true |
Definition at line 156 of file FullyConnectedMesh2.h.
Definition at line 175 of file FullyConnectedMesh2.h.
Definition at line 176 of file FullyConnectedMesh2.h.
Definition at line 167 of file FullyConnectedMesh2.h.
FCM2Guid RakNet::FullyConnectedMesh2::hostFCM2Guid [protected] |
Definition at line 173 of file FullyConnectedMesh2.h.
Definition at line 172 of file FullyConnectedMesh2.h.
Definition at line 169 of file FullyConnectedMesh2.h.
FCM2Guid RakNet::FullyConnectedMesh2::ourFCMGuid [protected] |
Definition at line 164 of file FullyConnectedMesh2.h.
Definition at line 153 of file FullyConnectedMesh2.h.
unsigned int RakNet::FullyConnectedMesh2::totalConnectionCount [protected] |
Definition at line 161 of file FullyConnectedMesh2.h.
Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.