SmartFoxServer Unity/.NET API
GetBuddyById Method (id)
NamespacesSmartFoxClientAPISmartFoxClientGetBuddyById(Int32)
Get a buddy from the buddy list, using the user id as key.
Refer to the buddyList property for a description of the buddy object's properties.
Declaration Syntax
C#Visual BasicVisual C++
public Buddy GetBuddyById(
	int id
)
Public Function GetBuddyById ( _
	id As Integer _
) As Buddy
public:
Buddy^ GetBuddyById(
	int id
)
Parameters
id (Int32)
the user id of the buddy.
Return Value
The buddy object.
Remarks

Since:
SmartFoxServer Pro v1.6.0

Version:
SmartFoxServer Pro

Examples
The following example shows how to retrieve a buddy from the buddy list.
CopyC#
Buddy buddy = smartFox.GetBuddyById(25);

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));
See Also

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