Package | com.smartfoxserver.v2.entities.managers |
Class | public class SFSBuddyManager |
Inheritance | SFSBuddyManager Object |
Implements | IBuddyManager |
See also
Property | Defined By | ||
---|---|---|---|
buddyList : Array [read-only]
Returns a list of Buddy objects representing all the buddies in the user's buddies list. | SFSBuddyManager | ||
buddyStates : Array [read-only]
Returns a list of strings representing the available custom buddy states. | SFSBuddyManager | ||
isInited : Boolean [read-only]
Indicates whether the client's Buddy List system is initialized or not. | SFSBuddyManager | ||
myNickName : String [read-only]
Returns the current user's nickname (if set). | SFSBuddyManager | ||
myOnlineState : Boolean [read-only]
Returns the current user's online/offline state. | SFSBuddyManager | ||
myState : String [read-only]
Returns the current user's custom state (if set). | SFSBuddyManager | ||
myVariables : Array [read-only]
Returns all the Buddy Variables associated with the current user. | SFSBuddyManager | ||
offlineBuddies : Array [read-only]
Returns a list of Buddy objects representing all the offline buddies in the user's buddies list. | SFSBuddyManager | ||
onlineBuddies : Array [read-only]
Returns a list of Buddy objects representing all the online buddies in the user's buddies list. | SFSBuddyManager |
Method | Defined By | ||
---|---|---|---|
SFSBuddyManager(sfs:SmartFox)
Creates a new SFSBuddyManager instance. | SFSBuddyManager | ||
containsBuddy(name:String):Boolean
Indicates whether a buddy exists in user's buddies list or not. | SFSBuddyManager | ||
getBuddyById(id:int):Buddy
Retrieves a Buddy object from its id property. | SFSBuddyManager | ||
getBuddyByName(name:String):Buddy
Retrieves a Buddy object from its name property. | SFSBuddyManager | ||
getBuddyByNickName(nickName:String):Buddy
Retrieves a Buddy object from its nickName property (if set). | SFSBuddyManager | ||
getMyVariable(varName:String):BuddyVariable
Retrieves a Buddy Variable from its name. | SFSBuddyManager |
buddyList | property |
buddyList:Array
[read-only]
Returns a list of Buddy objects representing all the buddies in the user's buddies list.
The list is null
if the Buddy List system is not initialized.
public function get buddyList():Array
buddyStates | property |
buddyStates:Array
[read-only] Returns a list of strings representing the available custom buddy states. The custom states are received by the client upon initialization of the Buddy List system. They can be configured by means of the SmartFoxServer 2X Administration Tool.
public function get buddyStates():Array
isInited | property |
isInited:Boolean
[read-only] Indicates whether the client's Buddy List system is initialized or not. If not, an InitBuddyListRequest request should be sent to the server in order to retrieve the persistent Buddy List data.
No Buddy List related operations are allowed until the system is initialized.
public function get isInited():Boolean
myNickName | property |
myNickName:String
[read-only]
Returns the current user's nickname (if set).
If the nickname was never set before, null
is returned.
As the nickname of a user in a buddy list is handled by means of a reserved Buddy Variable (see ReservedBuddyVariables class), it can be set using the SetBuddyVariablesRequest request.
public function get myNickName():String
myOnlineState | property |
myOnlineState:Boolean
[read-only]
Returns the current user's online/offline state.
If true
, the user appears to be online in the buddies list of other users who have him as a buddy.
The online state of a user in a buddy list is handled by means of a reserved Buddy Variable (see ReservedBuddyVariables class); it can be changed using the dedicated GoOnlineRequest request.
public function get myOnlineState():Boolean
myState | property |
myState:String
[read-only]
Returns the current user's custom state (if set).
Examples of custom states are "Available", "Busy", "Be right back", etc. If the custom state was never set before, null
is returned.
As the custom state of a user in a buddy list is handled by means of a reserved Buddy Variable (see ReservedBuddyVariables class), it can be set using the SetBuddyVariablesRequest request.
public function get myState():String
myVariables | property |
myVariables:Array
[read-only] Returns all the Buddy Variables associated with the current user.
public function get myVariables():Array
offlineBuddies | property |
offlineBuddies:Array
[read-only] Returns a list of Buddy objects representing all the offline buddies in the user's buddies list.
public function get offlineBuddies():Array
onlineBuddies | property |
onlineBuddies:Array
[read-only] Returns a list of Buddy objects representing all the online buddies in the user's buddies list.
public function get onlineBuddies():Array
SFSBuddyManager | () | Constructor |
public function SFSBuddyManager(sfs:SmartFox)
Creates a new SFSBuddyManager instance.
NOTE: developers never instantiate a SFSBuddyManager manually: this is done by the SmartFoxServer 2X API internally. A reference to the existing instance can be retrieved using the SmartFox.buddyManager property.
Parameterssfs:SmartFox — An instance of the SmartFoxServer 2X client API main SmartFox class.
|
See also
containsBuddy | () | method |
public function containsBuddy(name:String):Boolean
Indicates whether a buddy exists in user's buddies list or not.
Parameters
name:String — The name of the buddy whose presence in the buddies list is to be tested.
|
Boolean — true if the specified buddy exists in the buddies list.
|
getBuddyById | () | method |
public function getBuddyById(id:int):Buddy
Retrieves a Buddy object from its id property.
Parameters
id:int — The id of the buddy to be found.
|
Buddy — The Buddy object representing the buddy, or null if no buddy with the passed id exists in the buddies list.
|
getBuddyByName | () | method |
public function getBuddyByName(name:String):Buddy
Retrieves a Buddy object from its name property.
Parameters
name:String — The name of the buddy to be found.
|
Buddy — The Buddy object representing the buddy, or null if no buddy with the passed name exists in the buddies list.
|
getBuddyByNickName | () | method |
public function getBuddyByNickName(nickName:String):Buddy
Retrieves a Buddy object from its nickName property (if set).
Parameters
nickName:String — The nickName of the buddy to be found.
|
Buddy — The Buddy object representing the buddy, or null if no buddy with the passed nickName exists in the buddies list.
|
getMyVariable | () | method |
public function getMyVariable(varName:String):BuddyVariable
Retrieves a Buddy Variable from its name.
Parameters
varName:String — The name of the Buddy Variable to be retrieved.
|
BuddyVariable — The BuddyVariable object representing the Buddy Variable, or null if no Buddy Variable with the passed name is associated with the current user.
|