|
SmartFoxServer 3 C++ Client API 3.1.0-beta
Client API for SmartFoxServer 3
|
A client logged in SmartFoxServer that is "known" by the current client, that is, one who is inside one of the joined Rooms. More...
#include <User.h>
Public Member Functions | |
| virtual int32_t | getId () const =0 |
| virtual std::string | getName () const =0 |
| virtual int32_t | getPlayerId () const =0 |
| Returns the id of this user as a player in a Game Room. | |
| virtual int32_t | getPlayerId (const Room *room) const =0 |
| Returns the player id of this user in the given Room. | |
| virtual bool | isPlayer () const =0 |
Tells if this user is a player in the last joined Room, that is, his player id is greater than 0. | |
| virtual bool | isSpectator () const =0 |
Tells if this user is a spectator in the last joined Room, that is, his player id is lower than 0. | |
| virtual bool | isPlayerInRoom (const Room *room) const =0 |
| Tells if this user is a player in the given Room. | |
| virtual bool | isSpectatorInRoom (const Room *room) const =0 |
| Tells if this user is a spectator in the given Room. | |
| virtual bool | isJoinedInRoom (const Room *room) const =0 |
| Tells if this user joined the given Room. | |
| virtual int32_t | getPrivilegeId () const =0 |
| Returns the id of the privilege level of this user. | |
| virtual core::UserManager * | getUserManager () const =0 |
| virtual bool | isGuest () const =0 |
| Tells if this user logged in as a guest or not. | |
| virtual bool | isStandardUser () const =0 |
| Tells if this user logged in as a standard user or not. | |
| virtual bool | isModerator () const =0 |
| Tells if this user logged in as a moderator or not. | |
| virtual bool | isAdmin () const =0 |
| Tells if this user logged in as an administrator or not. | |
| virtual bool | isItMe () const =0 |
| Tells if this User object represents the current client. | |
| virtual std::vector< std::shared_ptr< UserVariable > > | getVariables () const =0 |
| virtual std::shared_ptr< UserVariable > | getVariable (const std::string &varName) const =0 |
| Retrieves a User Variable from its name. | |
| virtual bool | containsVariable (const std::string &name) const =0 |
| Tells if this user has the given User Variable set or not. | |
| virtual std::optional< Vec3D > | getAOIEntryPoint () const =0 |
| Returns the point inside the current user's Area of Interest where this user "appeared" with the last proximity list update, in an MMORoom. | |
A client logged in SmartFoxServer that is "known" by the current client, that is, one who is inside one of the joined Rooms.
SFSUser 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.
|
pure virtual |
Implemented in sfs3::entities::SFSUser.
|
pure virtual |
Implemented in sfs3::entities::SFSUser.
|
pure virtual |
Returns the id of this user as a player in a Game Room.
This is not the same as the id: it says which player number the user got inside a Game Room. For example, in a Game Room for 5 players the first client that joins gets player id 1, the second gets 2, and so on. When a user leaves the Room his slot is freed, and the next user who joins takes it.
The player id applies to Game Rooms only: in a standard Room it is always 0. In a Game Room a value lower than 0 means the user is a spectator.
A user inside more than one Game Room at the same time has a different player id in each of them. This method returns the value for the last joined Room; to read the value in a specific Room, use User::getPlayerId(const Room*) const.
Implemented in sfs3::entities::SFSUser.
|
pure virtual |
Returns the player id of this user in the given Room.
| room | The Room to read the player id from. |
Implemented in sfs3::entities::SFSUser.
|
pure virtual |
Tells if this user is a player in the last joined Room, that is, his player id is greater than 0.
A non-Game Room always gives false. For a user inside more than one Game Room at the same time, use User::isPlayerInRoom instead.
Implemented in sfs3::entities::SFSUser.
|
pure virtual |
Tells if this user is a spectator in the last joined Room, that is, his player id is lower than 0.
A non-Game Room always gives false. For a user inside more than one Game Room at the same time, use User::isSpectatorInRoom instead.
Implemented in sfs3::entities::SFSUser.
|
pure virtual |
Tells if this user is a player in the given Room.
A non-Game Room always gives false.
| room | The Room where to check if this user is a player. |
true if this user is a player in that Room.Implemented in sfs3::entities::SFSUser.
|
pure virtual |
Tells if this user is a spectator in the given Room.
A non-Game Room always gives false.
| room | The Room where to check if this user is a spectator. |
true if this user is a spectator in that Room.Implemented in sfs3::entities::SFSUser.
|
pure virtual |
Tells if this user joined the given Room.
| room | The Room where to check the presence of the user. |
true if this user is inside that Room. Implemented in sfs3::entities::SFSUser.
|
pure virtual |
Returns the id of the privilege level of this user.
The server assigns the privileges to the user when he logs in.
Implemented in sfs3::entities::SFSUser.
|
pure virtual |
Implemented in sfs3::entities::SFSUser.
|
pure virtual |
Tells if this user logged in as a guest or not.
A guest user has his privilege id set to UserPrivileges::GUEST.
true if this user is a guestImplemented in sfs3::entities::SFSUser.
|
pure virtual |
Tells if this user logged in as a standard user or not.
A standard user has his privilege id set to UserPrivileges::STANDARD.
true if this user is a standard userImplemented in sfs3::entities::SFSUser.
|
pure virtual |
Tells if this user logged in as a moderator or not.
A moderator has his privilege id set to UserPrivileges::MODERATOR.
true if this user is a moderatorImplemented in sfs3::entities::SFSUser.
|
pure virtual |
Tells if this user logged in as an administrator or not.
An administrator has his privilege id set to UserPrivileges::ADMINISTRATOR.
true if this user is an administratorImplemented in sfs3::entities::SFSUser.
|
pure virtual |
Tells if this User object represents the current client.
true if this is the current clientImplemented in sfs3::entities::SFSUser.
|
pure virtual |
Implemented in sfs3::entities::SFSUser.
|
pure virtual |
Retrieves a User Variable from its name.
Implemented in sfs3::entities::SFSUser.
|
pure virtual |
|
pure virtual |
Returns the point inside the current user's Area of Interest where this user "appeared" with the last proximity list update, in an MMORoom.
It is set only when the MMORoom is configured to send the entry points; otherwise the optional stays empty.
Implemented in sfs3::entities::SFSUser.