SmartFoxServer Unity/.NET API
buddyList Field
NamespacesSmartFoxClientAPISmartFoxClientbuddyList
An array containing the objects representing each buddy of the user's buddy list.
The buddy list can be iterated with a foreach loop, or a specific object can be retrieved by means of the GetBuddyById(Int32) and GetBuddyByName(String) methods.
Declaration Syntax
C#Visual BasicVisual C++
public SyncArrayList buddyList
Public buddyList As SyncArrayList
public:
SyncArrayList^ buddyList
Remarks

NOTE:
this property and all the buddy-related method are available only if the buddy list feature is enabled for the current zone. Check the SmartFoxServer server-side configuration.

Version:
SmartFoxServer Basic (except block status) / Pro

History:
SmartFoxServer Pro v1.6.0 - Buddy's isBlocked property added.

Examples
Each element in the buddy list is an object with the following properties:
termdescription
id
(int) the buddy id.
name
(string) the buddy name.
isOnline
(bool) the buddy online status: true if the buddy is online; false if the buddy is offline.
isBlocked
(bool) the buddy block status: true if the buddy is blocked; false if the buddy is not blocked; when a buddy is blocked, SmartFoxServer does not deliver private messages from/to that user.
variables
(object) an object with extra properties of the buddy (Buddy Variables); see also SetBuddyVariables(Hashtable)
The following example shows how to retrieve the properties of each buddy in the buddy list.
CopyC#
foreach (Buddy buddy in smartFox.buddyList)
{
    // Trace buddy properties
    Trace.WriteLine("Buddy id: " + buddy.GetId());
    Trace.WriteLine("Buddy name: " + buddy.GetName());
    Trace.WriteLine("Is buddy online? " + buddy.IsOnline());
    Trace.WriteLine("Is buddy blocked? " + buddy.IsBlocked());

    // Trace all Buddy Variables
    foreach (string v in buddy.GetVariables().Keys)
        Trace.WriteLine("\t" + v + " -- " + buddy.GetVariable(v));
 }
See Also

Assembly: SmartFoxClient (Module: SmartFoxClient) Version: 1.2.4.0 (1.2.4.0)