|
SmartFoxServer 3 C++ Client API 3.1.0-beta
Client API for SmartFoxServer 3
|
#include <Room.h>
Public Member Functions | |
| virtual int32_t | getId () const =0 |
| virtual std::string | getName () const =0 |
| Returns the unique name of this Room. | |
| virtual RoomType | getType () const =0 |
| virtual std::optional< std::string > | getGroupId () const =0 |
| Returns the name of the Group this Room belongs to. | |
| virtual int32_t | getMaxUsers () const =0 |
| Returns the maximum number of users allowed in this Room. | |
| virtual int32_t | getMaxSpectators () const =0 |
| Returns the maximum number of spectators allowed in this Room. | |
| virtual int32_t | getUserCount () const =0 |
| Returns the current number of users in this Room. | |
| virtual int32_t | getSpectatorCount () const =0 |
| virtual std::vector< std::shared_ptr< User > > | getPlayerList () const =0 |
| virtual std::vector< std::shared_ptr< User > > | getSpectatorList () const =0 |
| virtual bool | isGame () const =0 |
| Tells if this is a Game Room or not. | |
| virtual bool | isHidden () const =0 |
| Tells if this Room is hidden or not. | |
| virtual bool | isJoined () const =0 |
| Tells if the client joined this Room or not. | |
| virtual bool | isPasswordProtected () const =0 |
| Tells if this Room needs a password to be joined or not. | |
| virtual bool | containsUser (std::shared_ptr< entities::User > user) const =0 |
| Tells if the given user is currently inside this Room or not. | |
| virtual std::shared_ptr< User > | getUserById (int32_t id) const =0 |
| Retrieves a user inside this Room from his id. | |
| virtual std::shared_ptr< User > | getUserByName (const std::string &name) const =0 |
| Retrieves a user inside this Room from his name. | |
| virtual std::vector< std::shared_ptr< User > > | getUserList () const =0 |
| virtual core::RoomManager * | roomManager () const =0 |
| virtual std::shared_ptr< RoomVariable > | getVariable (const std::string &name) const =0 |
| Retrieves a Room Variable from its name. | |
| virtual std::vector< std::shared_ptr< RoomVariable > > | getVariables () const =0 |
| virtual bool | containsVariable (const std::string &name) const =0 |
| Tells if this Room has the given Room Variable set or not. | |
| virtual std::string | toString () const =0 |
A Room in a Zone.
SFSRoom is the standard implementation of this interface.
The setters are for the API itself: a value set by hand has no effect on the server and can disrupt the working of the API. Use the matching request to change a Room instead.
|
pure virtual |
Implemented in sfs3::entities::SFSRoom.
|
pure virtual |
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.
Implemented in sfs3::entities::SFSRoom.
|
pure virtual |
|
pure virtual |
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.
Implemented in sfs3::entities::SFSRoom.
|
pure virtual |
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.
Implemented in sfs3::entities::SFSRoom.
|
pure virtual |
Returns the maximum number of spectators allowed in this Room.
Game Rooms only.
The value is set when the Room is created.
Implemented in sfs3::entities::SFSRoom.
|
pure virtual |
Returns the current number of users in this Room.
In a Game Room this is the number of players.
Implemented in sfs3::entities::SFSRoom.
|
pure virtual |
Implemented in sfs3::entities::SFSRoom.
|
pure virtual |
Implemented in sfs3::entities::SFSRoom.
|
pure virtual |
Implemented in sfs3::entities::SFSRoom.
|
pure virtual |
Tells if this is a Game Room or not.
The flag is set when the Room is created.
Implemented in sfs3::entities::SFSRoom.
|
pure virtual |
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.
Implemented in sfs3::entities::SFSRoom.
|
pure virtual |
Tells if the client joined this Room or not.
To join a Room, send a requests::JoinRoomRequest.
Implemented in sfs3::entities::SFSRoom.
|
pure virtual |
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.
Implemented in sfs3::entities::SFSRoom.
|
pure virtual |
Tells if the given user is currently inside this Room or not.
| user | the user to look for |
Implemented in sfs3::entities::SFSRoom.
|
pure virtual |
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.Implemented in sfs3::entities::SFSRoom.
|
pure virtual |
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.Implemented in sfs3::entities::SFSRoom.
|
pure virtual |
Implemented in sfs3::entities::SFSRoom.
|
pure virtual |
Implemented in sfs3::entities::SFSRoom.
|
pure virtual |
Retrieves a Room Variable from its name.
Implemented in sfs3::entities::SFSRoom.
|
pure virtual |
Implemented in sfs3::entities::SFSRoom.
|
pure virtual |
|
pure virtual |
Implemented in sfs3::entities::MMORoom, and sfs3::entities::SFSRoom.