|
SmartFoxServer 3 C++ Client API 3.1.0-beta
Client API for SmartFoxServer 3
|
Sends a command to the server-side Extension attached to the Zone or to a Room. More...
#include <ExtensionRequest.h>
Public Member Functions | |
| ExtensionRequest (std::string cmdName, entities::SFSObject ¶ms, entities::Room *room=nullptr, net::TransportType txType=net::TransportType::TCP) | |
| Creates a new ExtensionRequest. | |
Sends a command to the server-side Extension attached to the Zone or to a Room.
Use it to send your own commands from the client to a server-side Extension, at Zone level or at Room level. The server answers with a event::SFSEvent::EXTENSION_RESPONSE event, which it also uses to send commands of its own to the client.
Read the SmartFoxServer 3 documentation about server-side Extensions for more information.
By default the request travels over TCP. It can travel over UDP instead, if a UDP connection is already up.
| sfs3::requests::ExtensionRequest::ExtensionRequest | ( | std::string | cmdName, |
| entities::SFSObject & | params, | ||
| entities::Room * | room = nullptr, | ||
| net::TransportType | txType = net::TransportType::TCP ) |
Creates a new ExtensionRequest.
Pass it to SmartFox::send for the request to be performed.
| cmdName | The name of the command to call on the server-side Extension. |
| params | The parameters of the call. Only borrowed: it is copied into the request before SmartFox::send returns. The copy is one level deep, so a nested SFSObject or SFSArray is shared with the object you passed, not cloned. |
| room | The Room whose Extension is called. When it is nullptr the Extension of the Zone is called instead. |
| txType | The transport that carries the request: TCP, or UDP when a UDP connection is up. |