SmartFoxServer 2X C++ API
Sfs2X::Core::SFSBuddyEvent Class Reference

This class contains all the Buddy List API related events More...

#include <SFSBuddyEvent.h>

Inheritance diagram for Sfs2X::Core::SFSBuddyEvent:
Sfs2X::Core::BaseEvent

Static Public Attributes

static boost::shared_ptr< string > BUDDY_LIST_INIT
 The Event is fired in response to a InitBuddyListRequest. More...
 
static boost::shared_ptr< string > BUDDY_ADD
 The Event is fired in response to a AddBuddyRequest. More...
 
static boost::shared_ptr< string > BUDDY_REMOVE
 The Event is fired in response to a RemoveBuddyRequest. More...
 
static boost::shared_ptr< string > BUDDY_BLOCK
 The Event is fired in response to a BlockBuddyRequest. More...
 
static boost::shared_ptr< string > BUDDY_ERROR
 The Event is fired in response to a failed Buddy request, such as AddBuddy, RemoveBuddy etc... More...
 
static boost::shared_ptr< string > BUDDY_ONLINE_STATE_UPDATE
 The Event is fired in response to a GoOnlineRequest. More...
 
static boost::shared_ptr< string > BUDDY_VARIABLES_UPDATE
 The Event is fired in response to a SetBuddyVariablesRequest. More...
 
static boost::shared_ptr< string > BUDDY_MESSAGE
 The Event is fired in response to a BuddyMessageRequest. More...
 

Additional Inherited Members

- Public Member Functions inherited from Sfs2X::Core::BaseEvent
boost::shared_ptr< map< string, boost::shared_ptr< void > > > Params ()
 A Hashtable containing the event's parameters. More...
 

Detailed Description

This class contains all the Buddy List API related events

Member Data Documentation

◆ BUDDY_ADD

boost::shared_ptr< string > Sfs2X::Core::SFSBuddyEvent::BUDDY_ADD
static

The Event is fired in response to a AddBuddyRequest.

After the Buddy List initialization the User will return to his previous Buddy state. His online/offline status, the Buddy state and his persistent Buddy Variables will all be loaded and broadcast in the system. In particular the online status determines if the User will appear online or not to other Users that have added him/her to their lists.

At this stage the custom Buddy states are also loaded and populated locally by the API.

The BaseEvent.Params object contains the following parameters.

parameter description
buddy (Buddy) the Buddy that was added
See also
Entities.SFSBuddy, Requests.AddBuddyRequest

◆ BUDDY_BLOCK

boost::shared_ptr< string > Sfs2X::Core::SFSBuddyEvent::BUDDY_BLOCK
static

The Event is fired in response to a BlockBuddyRequest.

The BaseEvent.Params object contains the following parameters.

parameter description
buddy (Buddy) the Buddy that was blocked/unblocked
See also
Entities.SFSBuddy, Requests.BlockBuddyRequest

◆ BUDDY_ERROR

boost::shared_ptr< string > Sfs2X::Core::SFSBuddyEvent::BUDDY_ERROR
static

The Event is fired in response to a failed Buddy request, such as AddBuddy, RemoveBuddy etc...

The BaseEvent.Params object contains the following parameters.

parameter description
errorMessage (string) the error message
errorCode (short) the error code

◆ BUDDY_LIST_INIT

boost::shared_ptr< string > Sfs2X::Core::SFSBuddyEvent::BUDDY_LIST_INIT
static

The Event is fired in response to a InitBuddyListRequest.

After the Buddy List initialization the User will return to his previous Buddy state. His online/offline status, the Buddy state and his persistent Buddy Variables will all be loaded and broadcast in the system. In particular the online status determines if the User will appear online or not to other Users that have added him/her to their lists.

At this stage the custom Buddy states are also loaded and populated locally by the API.

The BaseEvent.Params object contains the following parameters.

parameter description
buddyList (Array) a list of Buddy objects
myVariables (Array) a list of the User's BuddyVariable(s)

You can access them like this:

boost::shared_ptr<string> message (new string("Buddy States: " + ptrSmartFox->BuddyManager()->BuddyStates()->at(0)));
See also
Entities.SFSBuddy, Entities.Variables.SFSBuddyVariable, Requests.InitBuddyListRequest

◆ BUDDY_MESSAGE

boost::shared_ptr< string > Sfs2X::Core::SFSBuddyEvent::BUDDY_MESSAGE
static

The Event is fired in response to a BuddyMessageRequest.

The BaseEvent.Params object contains the following parameters.

parameter description
buddy (Buddy) the Buddy that updated the BuddyVariables
isItMe (bool) true if the Buddy is actually the current User
message (string) a list with the names of the Variables that where changed/set
data (ISFSObject) optional custom parameters
See also
Entities.SFSBuddy, Requests.BuddyMessageRequest

◆ BUDDY_ONLINE_STATE_UPDATE

boost::shared_ptr< string > Sfs2X::Core::SFSBuddyEvent::BUDDY_ONLINE_STATE_UPDATE
static

The Event is fired in response to a GoOnlineRequest.

The BaseEvent.Params object contains the following parameters.

parameter description
buddy (Buddy) the Buddy that was has changed his online status
isItMe (bool) true if the Buddy is actually the current User
See also
Entities.SFSBuddy, Requests.GoOnlineRequest

◆ BUDDY_REMOVE

boost::shared_ptr< string > Sfs2X::Core::SFSBuddyEvent::BUDDY_REMOVE
static

The Event is fired in response to a RemoveBuddyRequest.

The BaseEvent.Params object contains the following parameters.

parameter description
buddy (Buddy) the Buddy that was removed
See also
Entities.SFSBuddy, Requests.RemoveBuddyRequest

◆ BUDDY_VARIABLES_UPDATE

boost::shared_ptr< string > Sfs2X::Core::SFSBuddyEvent::BUDDY_VARIABLES_UPDATE
static

The Event is fired in response to a SetBuddyVariablesRequest.

The BaseEvent.Params object contains the following parameters.

parameter description
buddy (Buddy) the Buddy that updated the BuddyVariables
changedVars (Array) a list with the names of the Variables that where changed/set
isItMe (bool) true if the Buddy is actually the current User
See also
Entities.SFSBuddy, Requests.SetBuddyVariablesRequest