Dispatched when the buddy list for the current user is received or a buddy is added/removed.
- buddyList (ArrayList)
- the buddy list. Refer to the buddyList property for a description of the buddy object's properties.
Version:
SmartFoxServer Basic / Pro
The following example shows how to retrieve the properties of each buddy when the buddy list is received.
CopyC#
SFSEvent.onBuddyList += OnBuddyList; smartFox.LoadBuddyList(); public void OnBuddyList(ArrayList buddyList) { foreach (Buddy buddy in buddyList) { 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.WriteLine("Buddy Variables:"); foreach (string v in buddy.GetVariables().Keys) Trace.WriteLine("\t" + v + " -- " + buddy.GetVariable{v}); } }