Page 1 of 1

getPeople Example - explanation needed

Posted: 18 Jan 2011, 12:40
by sbn888
I have gotten the Database Recipe Get People Example working (using the same config for the server admin tool).

When I view the code for the client, I see this line in the onLogin handler.

sfs.send(new ExtensionRequest("getPeople", new SFSObject()))

Can someone explain the reference to "getPeople". How is it being used? Since it is not used in the naming of the extension or in the extension configuration, how does the client know which extension to call (eg Zone vs Room extension)? Is it an arbitrary name?

Also, why are we passing a new empty object to the server.

Thanks
Sbn

Posted: 18 Jan 2011, 22:27
by BigFIsh
You posted this in the wrong forum section, so this thread has been moved to an more appropriate section.

Posted: 19 Jan 2011, 02:54
by sbn888
Note to self: RTFM

ExtensionRequest () Constructor
------------------------------------------------

extCmd:String — The name of the command which identifies an action that should be executed by the server-side Extension.

params:ISFSObject — An instance of SFSObject containing custom data to be sent to the Extension.

room:Room (default = null) — If null, the specified command is sent to the current Zone server-side Extension; if not null, the command is sent to the server-side Extension attached to the passed Room.

useUDP:Boolean (default = false) — If not true, the UDP protocol is used to send the request to the server (check the SmartFox.udpAvailable property for more informations).


So I guess the name of the command can be anything you want it to be as it is an identifier