Get a buddy from the buddy list, using the buddy's username as key.
Refer to the buddyList property for a description of the buddy object's properties.
Refer to the buddyList property for a description of the buddy object's properties.
- buddyName (String)
- the username of the buddy.
The buddy object.
Since:
SmartFoxServer Pro v1.6.0
Version:
SmartFoxServer Pro
The following example shows how to retrieve a buddy from the buddy list.
CopyC#
Buddy buddy = smartFox.GetBuddyByName("jack"); 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));