SmartFoxServer 2X C++ API
|
The SFSBuddy class represent a Buddy in the User's Buddy List More...
#include <SFSBuddy.h>
Public Member Functions | |
long int | Id () |
The id of the Buddy More... | |
void | Id (long int value) |
The id of the Buddy More... | |
bool | IsBlocked () |
Return true if the Buddy is blocked in the current Users' BuddyList More... | |
void | IsBlocked (bool value) |
Return true if the Buddy is blocked in the current Users' BuddyList More... | |
bool | IsTemp () |
Return true if the Buddy is temporary (not persistent) More... | |
boost::shared_ptr< string > | Name () |
The name of the Buddy More... | |
bool | IsOnline () |
Return true if the User is online in the BuddyList system More... | |
boost::shared_ptr< string > | State () |
The current Buddy custom state (e.g. "Available", "Busy", etc...) More... | |
boost::shared_ptr< string > | NickName () |
An optional Buddy nickname More... | |
boost::shared_ptr< vector< boost::shared_ptr< BuddyVariable > > > | Variables () |
Obtain a list of BuddyVariables. More... | |
boost::shared_ptr< BuddyVariable > | GetVariable (string varName) |
Get the BuddyVariable with the provided name. More... | |
boost::shared_ptr< vector< boost::shared_ptr< BuddyVariable > > > | GetOfflineVariables () |
Return a list of offline Buddy Variables More... | |
boost::shared_ptr< vector< boost::shared_ptr< BuddyVariable > > > | GetOnlineVariables () |
Return a list of non-persistent Buddy Variables More... | |
bool | ContainsVariable (string varName) |
Return true if a BuddyVariable with the provided name exists More... | |
The SFSBuddy class represent a Buddy in the User's Buddy List
The SFSBuddy class represent a Buddy in the User's Buddy List. Each Buddy has several properties:
Any user can decide if they want to be online/off-line as Buddy in the Buddy system. By default a User is online every time he joins the Zone, but the User can also turn off this flag at runtime and disappear from other User's buddy lists. The Online State is persistent and based on a reserved Buddy Variable.
Buddies that are blocked won't be able to send any messages to the User, also they won't be able to see if the Buddy is online/off-line.
The state message represents a typical IM Buddy state such as Available, Busy etc... By default the system already provides 3 default states: Available, Away, Occupied which can be changed or enriched at any time The state message is based on a reserved Buddy Variable.
A temporary Buddy is added to the User List when another User adds me to his Buddy List. This way we can see each others and exchange messages. If I don't add the User as Buddy in my list the User will remain temporary and it won't be persisted.
Buddy Variables enable each Buddy to show/send updates for specific informations to each User that has the Buddy in the list. For example one could send real-time updates on his last activity (ala Twitter) or post the title of the song he's listening right now, scores, rankings and whatnot.
|
virtual |
Return true if a BuddyVariable with the provided name exists
varName | A string |
Implements Sfs2X::Entities::Buddy.
|
virtual |
Return a list of offline Buddy Variables
Implements Sfs2X::Entities::Buddy.
|
virtual |
Return a list of non-persistent Buddy Variables
Implements Sfs2X::Entities::Buddy.
|
virtual |
Get the BuddyVariable with the provided name.
Null is returned if not BuddyVariable exists with that name
varName | A string |
Implements Sfs2X::Entities::Buddy.
|
virtual |
The id of the Buddy
The id corresponds to the current id of the User in the system
Implements Sfs2X::Entities::Buddy.
|
virtual |
The id of the Buddy
The id corresponds to the current id of the User in the system
Implements Sfs2X::Entities::Buddy.
|
virtual |
Return true if the Buddy is blocked in the current Users' BuddyList
Implements Sfs2X::Entities::Buddy.
|
virtual |
Return true if the Buddy is blocked in the current Users' BuddyList
Implements Sfs2X::Entities::Buddy.
|
virtual |
Return true if the User is online in the BuddyList system
The value is stored in a reserved Buddy Variable
Implements Sfs2X::Entities::Buddy.
|
virtual |
Return true if the Buddy is temporary (not persistent)
Implements Sfs2X::Entities::Buddy.
|
virtual |
The name of the Buddy
Implements Sfs2X::Entities::Buddy.
|
virtual |
An optional Buddy nickname
The value is stored in a reserved Buddy Variable
Implements Sfs2X::Entities::Buddy.
|
virtual |
The current Buddy custom state (e.g. "Available", "Busy", etc...)
The value is stored in a reserved Buddy Variable
Implements Sfs2X::Entities::Buddy.
|
virtual |
Obtain a list of BuddyVariables.
Please note that by convention any variable whose name starts with the dollar sign ($) will be regarded as persistent and stored locally by the server.
These variables are also referred to as "offline variables" because they are available to other Users even when the Buddy is offline.
Implements Sfs2X::Entities::Buddy.