|
SmartFoxServer 3 C++ Client API 3.1.0-beta
Client API for SmartFoxServer 3
|
Sends an administrator message to a specific user or a group of users. More...
#include <AdminMessageRequest.h>
Public Member Functions | |
| AdminMessageRequest (std::string message, const entities::User &user, const entities::SFSObject *params=nullptr) | |
| Creates a new AdminMessageRequest targeting one specific user. | |
| AdminMessageRequest (std::string message, const entities::Room &room, const entities::SFSObject *params=nullptr) | |
| Creates a new AdminMessageRequest targeting all the users in a Room. | |
| AdminMessageRequest (std::string message, std::string groupId, const entities::SFSObject *params=nullptr) | |
| Creates a new AdminMessageRequest instance targeting all the clients who subscribed a specific Room Group. | |
| AdminMessageRequest (std::string message, const entities::SFSObject *params=nullptr) | |
| Creates a new AdminMessageRequest targeting every user in the Zone. | |
Sends an administrator message to a specific user or a group of users.
The current user must have administration privileges to be able to send the message (see the User::getPrivilegeId() property).
Which constructor is used determines the message recipients: a single user, all the users in a Room or in a Group, or the entire Zone. Upon message delivery, the clients of the recipient users dispatch the event::SFSEvent::ADMIN_MESSAGE event.
sfs.send(requests::AdminMessageRequest { "Server restart in 5 minutes" }); // the whole Zone
|
inline |
Creates a new AdminMessageRequest targeting one specific user.
Pass it to SmartFox::send for the request to be performed.
| message | The message to be sent to the target user. |
| user | The user the message should be delivered to. |
| params | Custom parameters to be sent to the recipient user; nullptr if none. Only borrowed: it is copied into the request before SmartFox::send returns. |
|
inline |
Creates a new AdminMessageRequest targeting all the users in a Room.
| message | The message to be sent to the users in the target Room. |
| room | The Room whose users the message should be delivered to. |
| params | Custom parameters to be sent to the recipient users; nullptr if none. |
|
inline |
Creates a new AdminMessageRequest instance targeting all the clients who subscribed a specific Room Group.
| message | The message to be sent to the clients subscribing the target Group. |
| groupId | The id of the Room Group the message should be delivered to. |
| params | Custom parameters to be sent to the recipient users; nullptr if none. |
|
inline |
Creates a new AdminMessageRequest targeting every user in the Zone.
| message | The message to be sent to all the users in the Zone. |
| params | Custom parameters to be sent to the recipient users; nullptr if none. |