NDIdentity Class Reference

Represents identity information about a NetDog node. More...

List of all members.

Public Member Functions

 NDIdentity (const void *p)
 Constructor, do not call this directly.
 ~NDIdentity ()
 Destructor, do not call this directly.
NDUserID getUserID (void)
 Gets an identity's UserID.
void setUserID (NDUserID id)
 Sets identity's UserID.
const char * getUserName (void)
 Gets an identity's username.
void setUserName (const char *name)
 Sets an identity's username.
const char * getPassword (void) const
 Gets an identity's password.
void setPassword (const char *name)
 Sets an identity's password.
NDNodeID getNodeID (void)
 Gets identity's NodeID.
void setNodeID (NDNodeID id)
 Sets an identity's NodeID.
NDObjectID getDefaultObject (void)
 Gets an identity's default ObjectID.
void setDefaultObject (NDObjectID oid)
 Sets an identity's default ObjectID.
NDUserID getProviderUserID (void)
 Gets the NodeID of the node that provided this NDIdentity information.
NDRole getRoleFlags (void) const
 Gets the NDRole flags of this identity.

Public Attributes

void * _nd_ident

Detailed Description

Examples of using NDIdentity:


	// ND: Setup our server's identity
	NDIdentity id = channel->getLocalIdentity();
	id.setNodeID(1);
	channel->setLocalIdentity(id);

    

Constructor & Destructor Documentation

NDIdentity::NDIdentity ( const void *  p  ) 

Constructor, do not call this directly

NDIdentity::~NDIdentity (  ) 

Destructor, do not call this directly


Member Function Documentation

NDObjectID NDIdentity::getDefaultObject ( void   ) 

Gets an identity's default ObjectID.

The default object for an identity is a single NDObject which is most closely related to that identity. This would normally be a player-record object. Any other identity-related objects can then be child objects of the default object.

Returns:
Default ObjectID of an identity
NDNodeID NDIdentity::getNodeID ( void   ) 

Gets an identity's NodeID.

See getUserID for details on NodeID vs UserID.

Returns:
NodeID of an identity
const char * NDIdentity::getPassword ( void   )  const

Gets an identity's password.

Returns:
The identity's password as a NULL terminated C-string.
NDUserID NDIdentity::getProviderUserID ( void   ) 

Gets the NodeID of the node that provided this NDIdentity information.

Returns:
NodeID of provider
NDRole NDIdentity::getRoleFlags ( void   )  const

Gets the NDRole flags of this identity.

Role flags can be used to determine a nodes role in the network.

The following roles are supported:

ND_ROLE_LOGIN_SERVER is set for nodes which are accepting login requests (servers)

ND_ROLE_SESSION_SERVER is set for nodes which manage events (servers)

ND_ROLE_OBJECT_SERVER is set for nodes which are object authorities (servers)

Returns:
NDRole flags of an identity
NDUserID NDIdentity::getUserID ( void   ) 

Gets an identity's UserID.

The concept of the NDUserID is different from a NDNodeID. An NDNodeID is a unique identifier for each instance of NetDog on the network. An NDUserID is a unique identifier for each user on the network.

So if a single user had multiple applications connected to the same NetDog server, then each application would have the same NDUserID, but different NDNodeIDs.

Returns:
UserID of identity
const char * NDIdentity::getUserName ( void   ) 

Gets an identity's username.

Returns:
The identity's username as a NULL terminated C-string.
void NDIdentity::setDefaultObject ( NDObjectID  oid  ) 

Sets an identity's default ObjectID.

Parameters:
oid New default ObjectID of an identity
void NDIdentity::setNodeID ( NDNodeID  id  ) 

Sets an identity's NodeID.

Parameters:
id New NodeID of an identity
void NDIdentity::setPassword ( const char *  name  ) 

Sets an identity's password.

Parameters:
name The identity's password as a NULL terminated C-string.
void NDIdentity::setUserID ( NDUserID  id  ) 

Sets an identity's UserID.

Parameters:
id New UserID of identity
void NDIdentity::setUserName ( const char *  name  ) 

Sets an identity's username.

Parameters:
name The identity's username as a NULL terminated C-string.

Generated on Wed Jul 21 18:14:48 2010 for nd2 by  doxygen 1.6.1