SmartFoxServer 2X C++ API
Sfs2X::Entities::Managers::SFSBuddyManager Class Reference

The class manages the current User's Buddy List More...

#include <SFSBuddyManager.h>

Inheritance diagram for Sfs2X::Entities::Managers::SFSBuddyManager:
Sfs2X::Entities::Managers::IBuddyManager

Public Member Functions

bool Inited ()
 Checks if the current User's Buddy List is inited. More...
 
void Inited (bool value)
 Checks if the current User's Buddy List is inited. More...
 
boost::shared_ptr< BuddyGetBuddyById (long int id)
 Find a Buddy from its User Id More...
 
bool ContainsBuddy (string name)
 Checks if a Buddy is present in the current User's Buddy List More...
 
boost::shared_ptr< BuddyGetBuddyByName (string name)
 Find a Buddy from its name More...
 
boost::shared_ptr< BuddyGetBuddyByNickName (string nickName)
 Find a Buddy from its optional nick name More...
 
boost::shared_ptr< vector< boost::shared_ptr< Buddy > > > OfflineBuddies ()
 Get a list of all online Buddies in the User's Buddy list More...
 
boost::shared_ptr< vector< boost::shared_ptr< Buddy > > > OnlineBuddies ()
 Get a list of all offline Buddies in the User's Buddy list More...
 
boost::shared_ptr< vector< boost::shared_ptr< Buddy > > > BuddyList ()
 Get the User's buddy list. It could be null if the Buddy List was not initialized More...
 
boost::shared_ptr< BuddyVariable > GetMyVariable (string varName)
 Get current Users' BuddyVariable by name More...
 
boost::shared_ptr< BuddyVariable > GetMyVariable (boost::shared_ptr< string > varName)
 Get current Users' BuddyVariable by name More...
 
boost::shared_ptr< vector< boost::shared_ptr< BuddyVariable > > > MyVariables ()
 Get all current User's Buddy Variables More...
 
void MyVariables (boost::shared_ptr< vector< boost::shared_ptr< BuddyVariable > > > value)
 Get all current User's Buddy Variables More...
 
bool MyOnlineState ()
 Get the current User's Online State More...
 
void MyOnlineState (bool value)
 Get the current User's Online State More...
 
boost::shared_ptr< string > MyNickName ()
 Get the current User's optional nickname More...
 
void MyNickName (string value)
 Get the current User's optional nickname More...
 
boost::shared_ptr< string > MyState ()
 Get the current User's optional custom state (e.g. "Available"; "Busy", "Be right back"...) More...
 
void MyState (string value)
 Get the current User's optional custom state (e.g. "Available"; "Busy", "Be right back"...) More...
 
boost::shared_ptr< vector< string > > BuddyStates ()
 Get a list of Strings representing the custom Buddy states that the application can use. The custom states are sent upon initialization of the Buddy List and are configured on the server side. More...
 
void BuddyStates (boost::shared_ptr< vector< string > > value)
 Get a list of Strings representing the custom Buddy states that the application can use. The custom states are sent upon initialization of the Buddy List and are configured on the server side. More...
 

Detailed Description

The class manages the current User's Buddy List

Member Function Documentation

◆ BuddyList()

boost::shared_ptr< vector< boost::shared_ptr< Buddy > > > Sfs2X::Entities::Managers::SFSBuddyManager::BuddyList ( )
virtual

Get the User's buddy list. It could be null if the Buddy List was not initialized

See also
Requests.InitBuddyListRequest

Implements Sfs2X::Entities::Managers::IBuddyManager.

◆ BuddyStates() [1/2]

boost::shared_ptr< vector< string > > Sfs2X::Entities::Managers::SFSBuddyManager::BuddyStates ( )
virtual

Get a list of Strings representing the custom Buddy states that the application can use. The custom states are sent upon initialization of the Buddy List and are configured on the server side.

Implements Sfs2X::Entities::Managers::IBuddyManager.

◆ BuddyStates() [2/2]

void Sfs2X::Entities::Managers::SFSBuddyManager::BuddyStates ( boost::shared_ptr< vector< string > >  value)
virtual

Get a list of Strings representing the custom Buddy states that the application can use. The custom states are sent upon initialization of the Buddy List and are configured on the server side.

Implements Sfs2X::Entities::Managers::IBuddyManager.

◆ ContainsBuddy()

bool Sfs2X::Entities::Managers::SFSBuddyManager::ContainsBuddy ( string  name)
virtual

Checks if a Buddy is present in the current User's Buddy List

Parameters
namethe Buddy name
Returns
true if the Buddy exists
See also
SFSBuddy

Implements Sfs2X::Entities::Managers::IBuddyManager.

◆ GetBuddyById()

boost::shared_ptr< Buddy > Sfs2X::Entities::Managers::SFSBuddyManager::GetBuddyById ( long int  id)
virtual

Find a Buddy from its User Id

Parameters
idthe user id
Returns
the Buddy, or null if not found
See also
SFSBuddy

Implements Sfs2X::Entities::Managers::IBuddyManager.

◆ GetBuddyByName()

boost::shared_ptr< Buddy > Sfs2X::Entities::Managers::SFSBuddyManager::GetBuddyByName ( string  name)
virtual

Find a Buddy from its name

Parameters
namethe Buddy name
Returns
the Buddy, or null if not found

Implements Sfs2X::Entities::Managers::IBuddyManager.

◆ GetBuddyByNickName()

boost::shared_ptr< Buddy > Sfs2X::Entities::Managers::SFSBuddyManager::GetBuddyByNickName ( string  nickName)
virtual

Find a Buddy from its optional nick name

Parameters
nickNameAthe nickname
Returns
the Buddy, or null if not found
See also
SFSBuddy

Implements Sfs2X::Entities::Managers::IBuddyManager.

◆ GetMyVariable() [1/2]

boost::shared_ptr< BuddyVariable > Sfs2X::Entities::Managers::SFSBuddyManager::GetMyVariable ( string  varName)
virtual

Get current Users' BuddyVariable by name

Parameters
varNamethe variable name
Returns
Pointer to a BuddyVariable instance

Implements Sfs2X::Entities::Managers::IBuddyManager.

◆ GetMyVariable() [2/2]

boost::shared_ptr< BuddyVariable > Sfs2X::Entities::Managers::SFSBuddyManager::GetMyVariable ( boost::shared_ptr< string >  varName)
virtual

Get current Users' BuddyVariable by name

Parameters
varNamethe variable name
Returns
Pointer to a BuddyVariable instance

Implements Sfs2X::Entities::Managers::IBuddyManager.

◆ Inited() [1/2]

bool Sfs2X::Entities::Managers::SFSBuddyManager::Inited ( )
virtual

Checks if the current User's Buddy List is inited.

If not you should send an InitBuddyListRequest to the server in order to retrieve your persistent Buddy List data.

See also
Requests.InitBuddyListRequest

Implements Sfs2X::Entities::Managers::IBuddyManager.

◆ Inited() [2/2]

void Sfs2X::Entities::Managers::SFSBuddyManager::Inited ( bool  value)
virtual

Checks if the current User's Buddy List is inited.

If not you should send an InitBuddyListRequest to the server in order to retrieve your persistent Buddy List data.

See also
Requests.InitBuddyListRequest

Implements Sfs2X::Entities::Managers::IBuddyManager.

◆ MyNickName() [1/2]

boost::shared_ptr< string > Sfs2X::Entities::Managers::SFSBuddyManager::MyNickName ( )
virtual

Get the current User's optional nickname

This operation is valid only if the User's BuddyList has already been initialized
The value is handled by a reserved Buddy Variable

Returns the Users' nickname or null if the nickname was never set

See also
ReservedBuddyVariables

Implements Sfs2X::Entities::Managers::IBuddyManager.

◆ MyNickName() [2/2]

void Sfs2X::Entities::Managers::SFSBuddyManager::MyNickName ( string  value)
virtual

Get the current User's optional nickname

This operation is valid only if the User's BuddyList has already been initialized
The value is handled by a reserved Buddy Variable

Returns the Users' nickname or null if the nickname was never set

See also
ReservedBuddyVariables

Implements Sfs2X::Entities::Managers::IBuddyManager.

◆ MyOnlineState() [1/2]

bool Sfs2X::Entities::Managers::SFSBuddyManager::MyOnlineState ( )
virtual

Get the current User's Online State

This operation is valid only if the User's BuddyList has already been initialized
The value is handled by a reserved Buddy Variable

Returns true if the User is online, false otherwise

See also
ReservedBuddyVariables

Implements Sfs2X::Entities::Managers::IBuddyManager.

◆ MyOnlineState() [2/2]

void Sfs2X::Entities::Managers::SFSBuddyManager::MyOnlineState ( bool  value)
virtual

Get the current User's Online State

This operation is valid only if the User's BuddyList has already been initialized
The value is handled by a reserved Buddy Variable

Returns true if the User is online, false otherwise

See also
ReservedBuddyVariables

Implements Sfs2X::Entities::Managers::IBuddyManager.

◆ MyState() [1/2]

boost::shared_ptr< string > Sfs2X::Entities::Managers::SFSBuddyManager::MyState ( )
virtual

Get the current User's optional custom state (e.g. "Available"; "Busy", "Be right back"...)

This operation is valid only if the User's BuddyList has already been initialized
The value is handled by a reserved Buddy Variable

See also
ReservedBuddyVariables

Implements Sfs2X::Entities::Managers::IBuddyManager.

◆ MyState() [2/2]

void Sfs2X::Entities::Managers::SFSBuddyManager::MyState ( string  value)
virtual

Get the current User's optional custom state (e.g. "Available"; "Busy", "Be right back"...)

This operation is valid only if the User's BuddyList has already been initialized
The value is handled by a reserved Buddy Variable

See also
ReservedBuddyVariables

Implements Sfs2X::Entities::Managers::IBuddyManager.

◆ MyVariables() [1/2]

boost::shared_ptr< vector< boost::shared_ptr< BuddyVariable > > > Sfs2X::Entities::Managers::SFSBuddyManager::MyVariables ( )
virtual

Get all current User's Buddy Variables

This operation is valid only if the User's BuddyList has already been initialized

See also
SFSBuddyVariable

Implements Sfs2X::Entities::Managers::IBuddyManager.

◆ MyVariables() [2/2]

void Sfs2X::Entities::Managers::SFSBuddyManager::MyVariables ( boost::shared_ptr< vector< boost::shared_ptr< BuddyVariable > > >  value)
virtual

Get all current User's Buddy Variables

This operation is valid only if the User's BuddyList has already been initialized

See also
SFSBuddyVariable

Implements Sfs2X::Entities::Managers::IBuddyManager.

◆ OfflineBuddies()

boost::shared_ptr< vector< boost::shared_ptr< Buddy > > > Sfs2X::Entities::Managers::SFSBuddyManager::OfflineBuddies ( )
virtual

Get a list of all online Buddies in the User's Buddy list

Implements Sfs2X::Entities::Managers::IBuddyManager.

◆ OnlineBuddies()

boost::shared_ptr< vector< boost::shared_ptr< Buddy > > > Sfs2X::Entities::Managers::SFSBuddyManager::OnlineBuddies ( )
virtual

Get a list of all offline Buddies in the User's Buddy list

Implements Sfs2X::Entities::Managers::IBuddyManager.