AddBuddyRequest Class |
Namespace: Sfs2X.Requests.Buddylist
public class AddBuddyRequest : BaseRequest
The AddBuddyRequest type exposes the following members.
Name | Description | |
---|---|---|
AddBuddyRequest |
Creates a new AddBuddyRequest instance.
|
void SomeMethod() { sfs.AddEventListener(SFSBuddyEvent.BUDDY_ADD, OnBuddyAdded); sfs.AddEventListener(SFSBuddyEvent.BUDDY_ERROR, OnBuddyError); // Add Jack as a new buddy to my buddies list sfs.Send(new AddBuddyRequest("Jack")); } void OnBuddyAdded(BaseEvent evt) { Console.WriteLine("Buddy was added: " + (Buddy)evt.Params["buddy"]); // .Net / Unity System.Diagnostics.Debug.WriteLine("Buddy was added: " + (Buddy)evt.Params["buddy"]); // UWP } void OnBuddyError(BaseEvent evt) { Console.WriteLine("The following error occurred while executing a buddy-related request: " + (string)evt.Params["errorMessage"]); // .Net / Unity System.Diagnostics.Debug.WriteLine("The following error occurred while executing a buddy-related request: " + (string)evt.Params["errorMessage"]); // UWP }