BlockBuddyRequest Class |
Namespace: Sfs2X.Requests.Buddylist
public class BlockBuddyRequest : BaseRequest
The BlockBuddyRequest type exposes the following members.
Name | Description | |
---|---|---|
BlockBuddyRequest |
Creates a new BlockBuddyRequest instance.
|
void SomeMethod() { sfs.AddEventListener(SFSBuddyEvent.BUDDY_BLOCK, onBuddyBlock); sfs.AddEventListener(SFSBuddyEvent.BUDDY_ERROR, OnBuddyError); // Block Jack in my buddies list sfs.Send(new BlockBuddyRequest("Jack", true)); } void onBuddyBlock(BaseEvent evt) { Buddy buddy = (Buddy)evt.Params["buddy"]; Console.WriteLine("Buddy " + buddy.Name + " is now " + (buddy.IsBlocked ? "blocked" : "unblocked")); // .Net / Unity System.Diagnostics.Debug.WriteLine("Buddy " + buddy.Name + " is now " + (buddy.IsBlocked ? "blocked" : "unblocked")); // 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 }