Add a user to the buddy list.
Since SmartFoxServer Pro 1.6.0, the buddy list feature can be configured to use a basic or advanced security mode (see the SmartFoxServer server-side configuration file).
Check the following usage notes for details on the behavior of the AddBuddy method in the two cases.
Since SmartFoxServer Pro 1.6.0, the buddy list feature can be configured to use a basic or advanced security mode (see the SmartFoxServer server-side configuration file).
Check the following usage notes for details on the behavior of the AddBuddy method in the two cases.


- buddyName (String)
- the name of the user to be added to the buddy list.

Sends:
SFSEvent..::.OnBuddyListDelegate
SFSEvent..::.OnBuddyListErrorDelegate
SFSEvent..::.OnBuddyPermissionRequestDelegate
Usage Note:
Basic security mode
When a buddy is added, if the buddy list is already full, the SFSEvent..::.OnBuddyListErrorDelegate event is fired; otherwise the buddy list is updated and the SFSEvent..::.OnBuddyListDelegate event is fired.
Advanced security mode If the <addBuddyPermission> parameter is set to true in the buddy list configuration section of a zone, before the user is actually added to the buddy list he/she must grant his/her permission. The permission request is sent if the user is online only; the user receives the {@link SFSEvent#onBuddyPermissionRequest} event. When the permission is granted, the buddy list is updated and the SFSEvent..::.OnBuddyListDelegate event is fired. If the permission is not granted (or the buddy didn't receive the permission request), the addBuddy method can be called again after a certain amount of time only. This time is set in the server configuration <permissionTimeOut> parameter. Also, if the <mutualAddBuddy> parameter is set to true, when user A adds user B to the buddy list, he/she is automatically added to user B's buddy list. Lastly, if the buddy list is full, the SFSEvent..::.OnBuddyListErrorDelegate event is fired.
History:
SmartFoxServer Pro v1.6.0 - Buddy list's advanced security mode implemented.
Version:
SmartFoxServer Basic (except advanced mode) / Pro

The following example shows how to add a user to the buddy list.
CopyC#

smartFox.AddBuddy("jack");
