GoOnlineRequest Class |
Namespace: Sfs2X.Requests.Buddylist
public class GoOnlineRequest : BaseRequest
The GoOnlineRequest type exposes the following members.
Name | Description | |
---|---|---|
GoOnlineRequest |
Creates a new GoOnlineRequest instance.
|
void SomeMethod() { sfs.AddEventListener(SFSBuddyEvent.BUDDY_ONLINE_STATE_UPDATE, OnBuddyOnlineStateUpdate); // Put myself offline in the Buddy List system sfs.Send(new GoOnlineRequest(false)); } void OnBuddyOnlineStateUpdate(BaseEvent evt) { // As the state change event is dispatched to me too, // I have to check if I am the one who changed his state bool isItMe = (bool)evt.Params["isItMe"]; Buddy buddy = (Buddy)evt.Params["buddy"]; if (isItMe) { Console.WriteLine("I'm now " + (sfs.BuddyManager.MyOnlineState ? "online" : "offline")); // .Net / Unity System.Diagnostics.Debug.WriteLine("I'm now " + (sfs.BuddyManager.MyOnlineState ? "online" : "offline")); // UWP } else { Console.WriteLine("My buddy " + buddy.Name + " is now", (buddy.IsOnline ? "online" : "offline")); // .Net / Unity System.Diagnostics.Debug.WriteLine("My buddy " + buddy.Name + " is now", (buddy.IsOnline ? "online" : "offline")); // UWP } }