|
SmartFoxServer 3 C++ Client API 3.1.0-beta
Client API for SmartFoxServer 3
|
The standard implementation of Room: a SmartFoxServer Room on the client. More...
#include <SFSRoom.h>
Public Member Functions | |
| int32_t | getId () const override |
| std::string | getName () const override |
| Returns the unique name of this Room. | |
| RoomType | getType () const override |
| std::optional< std::string > | getGroupId () const override |
| Returns the name of the Group this Room belongs to. | |
| int32_t | getUserCount () const override |
| Returns the current number of users in this Room. | |
| int32_t | getSpectatorCount () const override |
| int32_t | getMaxUsers () const override |
| Returns the maximum number of users allowed in this Room. | |
| int32_t | getMaxSpectators () const override |
| Returns the maximum number of spectators allowed in this Room. | |
| std::vector< std::shared_ptr< User > > | getPlayerList () const override |
| std::vector< std::shared_ptr< User > > | getSpectatorList () const override |
| bool | isGame () const override |
| Tells if this is a Game Room or not. | |
| bool | isHidden () const override |
| Tells if this Room is hidden or not. | |
| bool | isJoined () const override |
| Tells if the client joined this Room or not. | |
| bool | isPasswordProtected () const override |
| Tells if this Room needs a password to be joined or not. | |
| bool | containsUser (std::shared_ptr< entities::User > user) const override |
| Tells if the given user is currently inside this Room or not. | |
| std::shared_ptr< User > | getUserById (int32_t id) const override |
| Retrieves a user inside this Room from his id. | |
| std::shared_ptr< User > | getUserByName (const std::string &name) const override |
| Retrieves a user inside this Room from his name. | |
| std::vector< std::shared_ptr< User > > | getUserList () const override |
| core::RoomManager * | roomManager () const override |
| std::shared_ptr< RoomVariable > | getVariable (const std::string &name) const override |
| Retrieves a Room Variable from its name. | |
| std::vector< std::shared_ptr< RoomVariable > > | getVariables () const override |
| bool | containsVariable (const std::string &name) const override |
| Tells if this Room has the given Room Variable set or not. | |
| std::string | toString () const override |
The standard implementation of Room: a SmartFoxServer Room on the client.
The client API does not know all the Rooms that exist on the server, but only the ones the user joined and the ones in the Room Groups he subscribed. A subscription to a Group lets the client listen to the events of every Room in that Group.
The list of available Rooms is built after a successful login, and the server keeps it up to date.
|
inlineoverridevirtual |
Implements sfs3::entities::Room.
|
inlineoverridevirtual |
Returns the unique name of this Room.
Two Rooms in the same Zone cannot have the same name. The comparison is case sensitive.
To rename a Room, send a requests::ChangeRoomNameRequest.
Implements sfs3::entities::Room.
|
inlineoverridevirtual |
|
inlineoverridevirtual |
Returns the name of the Group this Room belongs to.
Each Group is identified by a unique string, its name, and it is a different "container" for Rooms. Groups let you sort the Rooms by type or category, and let a client select only the Groups it needs, to receive the events of those Rooms only. A client subscribes and unsubscribes a Group with a requests::SubscribeRoomGroupRequest and a requests::UnsubscribeRoomGroupRequest.
The default value is DEFAULT_ROOM_GROUP_ID.
Implements sfs3::entities::Room.
|
overridevirtual |
Returns the current number of users in this Room.
In a Game Room this is the number of players.
Implements sfs3::entities::Room.
|
overridevirtual |
Implements sfs3::entities::Room.
|
inlineoverridevirtual |
Returns the maximum number of users allowed in this Room.
In a Game Room this is the maximum number of players. The value is set when the Room is created.
Implements sfs3::entities::Room.
|
inlineoverridevirtual |
Returns the maximum number of spectators allowed in this Room.
Game Rooms only.
The value is set when the Room is created.
Implements sfs3::entities::Room.
|
overridevirtual |
Implements sfs3::entities::Room.
|
overridevirtual |
Implements sfs3::entities::Room.
|
overridevirtual |
Tells if this is a Game Room or not.
The flag is set when the Room is created.
Implements sfs3::entities::Room.
|
overridevirtual |
Tells if this Room is hidden or not.
This flag is a convenience for developers, to keep certain Rooms out of the interface of their application. It is set when the Room is created.
Implements sfs3::entities::Room.
|
overridevirtual |
Tells if the client joined this Room or not.
To join a Room, send a requests::JoinRoomRequest.
Implements sfs3::entities::Room.
|
overridevirtual |
Tells if this Room needs a password to be joined or not.
The flag depends on the password set when the Room is created, or later with a requests::ChangeRoomPasswordStateRequest.
Implements sfs3::entities::Room.
|
overridevirtual |
Tells if the given user is currently inside this Room or not.
| user | the user to look for |
Implements sfs3::entities::Room.
|
overridevirtual |
Retrieves a user inside this Room from his id.
| id | The id of the user to find. |
nullptr if no user with that id is in this Room.Implements sfs3::entities::Room.
|
overridevirtual |
Retrieves a user inside this Room from his name.
| name | The name of the user to find. |
nullptr if no user with that name is in this Room.Implements sfs3::entities::Room.
|
overridevirtual |
Implements sfs3::entities::Room.
|
overridevirtual |
Implements sfs3::entities::Room.
|
overridevirtual |
Retrieves a Room Variable from its name.
Implements sfs3::entities::Room.
|
overridevirtual |
Implements sfs3::entities::Room.
|
overridevirtual |
|
overridevirtual |
Implements sfs3::entities::Room.