SLikeNet 0.1.3

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SLNet::NetworkIDManager Class Reference

`#include <slikenet/NetworkIDManager.h>`

## Public Member Functions

| NetworkIDManager ()
virtual | ~NetworkIDManager (void)
template<class returnType >
returnType | GET_OBJECT_FROM_ID (NetworkID x)
void | Clear (void)
NetworkIDObject * | GET_BASE_OBJECT_FROM_ID (NetworkID x)

## Protected Member Functions

void | TrackNetworkIDObject (NetworkIDObject *networkIdObject)
void | StopTrackingNetworkIDObject (NetworkIDObject *networkIdObject)
unsigned int | NetworkIDToHashIndex (NetworkID networkId)
NetworkID | GetNewNetworkID (void)

## Protected Attributes

NetworkIDObject * | networkIdHash [NETWORK_ID_MANAGER_HASH_LENGTH]
uint64_t | startingOffset

## Detailed Description

This class is simply used to generate a unique number for a group of instances of NetworkIDObject An instance of this class is required to use the ObjectID to pointer lookup system You should have one instance of this class per game instance. Call SetIsNetworkIDAuthority before using any functions of this class, or of NetworkIDObject

Definition at line 40 of file NetworkIDManager.h.

## Constructor & Destructor Documentation

NetworkIDManager::NetworkIDManager | ( |  | ) |

Definition at line 32 of file NetworkIDManager.cpp.

References SLNet::RakPeerInterface::Get64BitUniqueRandomNumber().

NetworkIDManager::~NetworkIDManager | ( | void |  | ) |

virtual

Definition at line 37 of file NetworkIDManager.cpp.

## Member Function Documentation

void NetworkIDManager::Clear | ( | void |  | ) |

Definition at line 41 of file NetworkIDManager.cpp.

References networkIdHash.

NetworkIDObject * NetworkIDManager::GET_BASE_OBJECT_FROM_ID | ( | NetworkID | x | ) |

Definition at line 45 of file NetworkIDManager.cpp.

References SLNet::NetworkIDObject::GetNetworkID(), networkIdHash, NetworkIDToHashIndex(), and SLNet::NetworkIDObject::nextInstanceForNetworkIDManager.

Referenced by GetNewNetworkID().

template<class returnType >

returnType SLNet::NetworkIDManager::GET_OBJECT_FROM_ID | ( | NetworkID | x | ) |

inline

Returns the parent object, or this instance if you don't use a parent. Supports NetworkIDObject anywhere in the inheritance hierarchy

Precondition
  You must first call SetNetworkIDManager before using this function

Definition at line 53 of file NetworkIDManager.h.

References SLNet::NetworkIDObject::GetParent().

NetworkID NetworkIDManager::GetNewNetworkID | ( | void |  | ) |

protected

Definition at line 57 of file NetworkIDManager.cpp.

References GET_BASE_OBJECT_FROM_ID(), startingOffset, and SLNet::UNASSIGNED_NETWORK_ID.

Referenced by SLNet::NetworkIDObject::SetNetworkIDManager().

unsigned int NetworkIDManager::NetworkIDToHashIndex | ( | NetworkID | networkId | ) |

protected

Definition at line 68 of file NetworkIDManager.cpp.

References NETWORK_ID_MANAGER_HASH_LENGTH.

Referenced by GET_BASE_OBJECT_FROM_ID(), StopTrackingNetworkIDObject(), and TrackNetworkIDObject().

void NetworkIDManager::StopTrackingNetworkIDObject | ( | NetworkIDObject * | networkIdObject | ) |

protected

Definition at line 106 of file NetworkIDManager.cpp.

References SLNet::NetworkIDObject::GetNetworkID(), SLNet::NetworkIDObject::GetNetworkIDManager(), networkIdHash, NetworkIDToHashIndex(), SLNet::NetworkIDObject::nextInstanceForNetworkIDManager, RakAssert, and SLNet::UNASSIGNED_NETWORK_ID.

Referenced by SLNet::NetworkIDObject::SetNetworkID(), SLNet::NetworkIDObject::SetNetworkIDManager(), and SLNet::NetworkIDObject::~NetworkIDObject().

void NetworkIDManager::TrackNetworkIDObject | ( | NetworkIDObject * | networkIdObject | ) |

protected

Definition at line 73 of file NetworkIDManager.cpp.

References SLNet::NetworkIDObject::GetNetworkID(), SLNet::NetworkIDObject::GetNetworkIDManager(), networkIdHash, NetworkIDToHashIndex(), SLNet::NetworkIDObject::nextInstanceForNetworkIDManager, RakAssert, and SLNet::UNASSIGNED_NETWORK_ID.

Referenced by SLNet::NetworkIDObject::SetNetworkID(), and SLNet::NetworkIDObject::SetNetworkIDManager().

## Member Data Documentation

NetworkIDObject* SLNet::NetworkIDManager::networkIdHash[NETWORK_ID_MANAGER_HASH_LENGTH]

protected

Definition at line 75 of file NetworkIDManager.h.

Referenced by Clear(), GET_BASE_OBJECT_FROM_ID(), StopTrackingNetworkIDObject(), and TrackNetworkIDObject().

uint64_t SLNet::NetworkIDManager::startingOffset

protected

Definition at line 77 of file NetworkIDManager.h.

Referenced by GetNewNetworkID().

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

- Source/include/slikenet/NetworkIDManager.h
- Source/src/NetworkIDManager.cpp