sendXtMessage()

Availability:

SmartFoxServer Pro

Usage:

smartFox.sendXtMessage(xtName <String>, cmdName <String>, paramObj <propList>, type <String>, roomId <integer>)

Description:

Sends a request to an extension in the current Zone / Room

Parameters:

xtName   name of the extension to call
cmdName   name of the command to execute in the extension
paramObj   a propertylist containing all the data to pass to the extension
type   can be "xml" or "str", based on the type of protocol you want to use. By default "xml" is used
roomId   (optional) the id of the room where the request is coming from

Returns:

Fires the onExtensionResponse event

Example:

// A bullet is being fired
// Let's notify the server side extension
request =[#type:"bullet", #posx:100, #posy:200, #speed:10, #angle:45]
// Invoke "fire" command on the extension called "gameExt" smartFox.sendXtMessage("gameExt", "fire", request)


You can learn more about Server side extensions by checking section 6 of the SmartFoxServer PRO documentation.

See also:

onPublicMessage, sendPrivateMessage()