ExtensionRequest Class |
Namespace: Sfs2X.Requests
public class ExtensionRequest : BaseRequest
Name | Description | |
---|---|---|
ExtensionRequest(String, ISFSObject) |
See ExtensionRequest(string, ISFSObject, Room, bool) constructor.
| |
ExtensionRequest(String, ISFSObject, Room) |
See ExtensionRequest(string, ISFSObject, Room, bool) constructor.
| |
ExtensionRequest(String, ISFSObject, Room, Boolean) |
Creates a new ExtensionRequest instance.
|
void SomeMethod() { sfs.addEventListener(SFSEvent.EXTENSION_RESPONSE, OnExtensionResponse); // Send two integers to the Zone extension and get their sum in return ISFSObject params = SFSObject.NewInstance(); params.PutInt("n1", 26); params.PutInt("n2", 16); sfs.Send( new ExtensionRequest("add", params) ); } void OnExtensionResponse(BaseEvent evt) { String cmd = (String)evt.Params["cmd"]; if (cmd == "add") { ISFSObject responseParams = (SFSObject)evt.Params["params"]; // We expect an int parameter called "sum" Console.WriteLine("The sum is: " + responseParams.GetInt("sum")); // .Net / Unity System.Diagnostics.Debug.WriteLine("The sum is: " + responseParams.GetInt("sum")); // UWP } }