SmartFoxServer 3 C++ Client API 3.1.0-beta
Client API for SmartFoxServer 3
Loading...
Searching...
No Matches
sfs3::requests::ExtensionRequest Class Reference

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

#include <ExtensionRequest.h>

Inheritance diagram for sfs3::requests::ExtensionRequest:
[legend]

Public Member Functions

 ExtensionRequest (std::string cmdName, entities::SFSObject &params, entities::Room *room=nullptr, net::TransportType txType=net::TransportType::TCP)
 Creates a new ExtensionRequest.

Detailed Description

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.

See also
SmartFox::connectUdp
SmartFox::isUdpConnected
event::SFSEvent::EXTENSION_RESPONSE
ExtensionAsyncRequest

Constructor & Destructor Documentation

◆ ExtensionRequest()

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.

Parameters
cmdNameThe name of the command to call on the server-side Extension.
paramsThe 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.
roomThe Room whose Extension is called. When it is nullptr the Extension of the Zone is called instead.
txTypeThe transport that carries the request: TCP, or UDP when a UDP connection is up.
See also
SmartFox::send
entities::SFSObject

The documentation for this class was generated from the following files:
  • requests/ExtensionRequest.h
  • requests/ExtensionRequest.cpp