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

Sets one or more custom User Variables for the current user. More...

#include <SetUserVariablesRequest.h>

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

Public Member Functions

 SetUserVariablesRequest (std::vector< std::shared_ptr< entities::UserVariable > > varList)
 Creates a new SetUserVariablesRequest.
 SetUserVariablesRequest (const std::vector< entities::SFSUserVariable > &vars)
 Creates a new SetUserVariablesRequest from concrete variables.

Detailed Description

Sets one or more custom User Variables for the current user.

When a User Variable is set, a event::SFSEvent::USER_VARIABLES_UPDATE event reaches every user in every Room the current user joined, himself included.

NOTE: the event reaches the users of a Room only if that Room allows it (see the permissions setting in RoomSettings).

See also
event::SFSEvent::USER_VARIABLES_UPDATE
RoomSettings::permissions

Constructor & Destructor Documentation

◆ SetUserVariablesRequest() [1/2]

sfs3::requests::SetUserVariablesRequest::SetUserVariablesRequest ( std::vector< std::shared_ptr< entities::UserVariable > > varList)
inline

Creates a new SetUserVariablesRequest.

Pass it to SmartFox::send for the request to be performed.

Parameters
varListThe User Variables to set.
See also
SmartFox::send
entities::UserVariable

◆ SetUserVariablesRequest() [2/2]

sfs3::requests::SetUserVariablesRequest::SetUserVariablesRequest ( const std::vector< entities::SFSUserVariable > & vars)
inline

Creates a new SetUserVariablesRequest from concrete variables.

This overload saves you from wrapping each variable in a shared pointer. Each one is copied into the request, keeping its concrete type.

Parameters
varsThe User Variables to set.
See also
SmartFox::send

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