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

Sets one or more custom Room Variables in a Room. More...

#include <SetRoomVariablesRequest.h>

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

Public Member Functions

 SetRoomVariablesRequest (std::vector< std::shared_ptr< entities::RoomVariable > > varList, std::shared_ptr< entities::Room > room=nullptr)
 Creates a new SetRoomVariablesRequest.
 SetRoomVariablesRequest (const std::vector< entities::SFSRoomVariable > &vars, std::shared_ptr< entities::Room > room=nullptr)
 Creates a new SetRoomVariablesRequest from concrete variables.

Detailed Description

Sets one or more custom Room Variables in a Room.

When a Room Variable is set, a event::SFSEvent::ROOM_VARIABLES_UPDATE event reaches every user in the target Room, the one who set it included. If the Room Variable is global, the event also reaches every user who subscribed the Group of that Room.

See also
event::SFSEvent::ROOM_VARIABLES_UPDATE
entities::SFSRoomVariable
RoomSettings::permissions

Constructor & Destructor Documentation

◆ SetRoomVariablesRequest() [1/2]

sfs3::requests::SetRoomVariablesRequest::SetRoomVariablesRequest ( std::vector< std::shared_ptr< entities::RoomVariable > > varList,
std::shared_ptr< entities::Room > room = nullptr )
inline

Creates a new SetRoomVariablesRequest.

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

Parameters
varListThe Room Variables to set.
roomThe Room where to set them. When it is nullptr the last Room joined by the current user is used.
See also
SmartFox::send
entities::RoomVariable

◆ SetRoomVariablesRequest() [2/2]

sfs3::requests::SetRoomVariablesRequest::SetRoomVariablesRequest ( const std::vector< entities::SFSRoomVariable > & vars,
std::shared_ptr< entities::Room > room = nullptr )
inline

Creates a new SetRoomVariablesRequest 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 Room Variables to set.
roomThe Room where to set them. When it is nullptr the last Room joined by the current user is used.
See also
SmartFox::send

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