ExtensionRequest

Sends a command to the server-side Extension attached to the Zone or to a Room.


This request is used to send custom commands from the client to a server-side Extension, whether at Zone-level or Room-level. Conversely, the SFSEvent.EXTENSION_RESPONSE event is used by the server to send Extension commands/responses to the client.

Read the SmartFoxServer documentation about server-side Extensions for more information.

Constructor

new ExtensionRequest(extCmd, parametersopt, roomopt)

Creates a new instance of the ExtensionRequest class.
Pass the instance to the SmartFox#send method to validate and execute the request.
Parameters:
NameTypeAttributesDefaultDescription
extCmdstringThe name of the command which identifies an action that should be executed by the server-side Extension.
parametersSFSObject<optional>
nullAn object containing custom data to be sent to the Extension; can be null if no data is needed.
roomSFSRoom<optional>
nullIf null, the specified command is sent to the server-side Extension attached to the currently joined Zone; if not null, the command is sent to the server-side Extension attached to the passed Room.