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

Turns the current user from player to spectator in a Game Room. More...

#include <PlayerToSpectatorRequest.h>

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

Public Member Functions

 PlayerToSpectatorRequest (std::shared_ptr< entities::Room > targetRoom=nullptr)

Detailed Description

Turns the current user from player to spectator in a Game Room.

If the operation is successful, all the users in the target Room are notified with the PLAYER_TO_SPECTATOR event. The operation could fail if no spectator slots are available in the Game Room at the time of the request; in this case the PLAYER_TO_SPECTATOR_ERROR event is dispatched to the requester's client.

See also
SpectatorToPlayerRequest

Constructor & Destructor Documentation

◆ PlayerToSpectatorRequest()

sfs3::requests::PlayerToSpectatorRequest::PlayerToSpectatorRequest ( std::shared_ptr< entities::Room > targetRoom = nullptr)
inline
Parameters
targetRoomthe Room in which the player should be turned to spectator; if nullptr, the last Room joined by the current user is used

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