|
SmartFoxServer 3 C++ Client API 3.1.0-beta
Client API for SmartFoxServer 3
|
The standard implementation of User: a client logged in SmartFoxServer. More...
#include <SFSUser.h>
Public Member Functions | |
| int32_t | getId () const override |
| std::string | getName () const override |
| int32_t | getPlayerId () const override |
| Returns the id of this user as a player in a Game Room. | |
| int32_t | getPlayerId (const Room *room) const override |
| Returns the player id of this user in the given Room. | |
| bool | isPlayer () const override |
Tells if this user is a player in the last joined Room, that is, his player id is greater than 0. | |
| bool | isSpectator () const override |
Tells if this user is a spectator in the last joined Room, that is, his player id is lower than 0. | |
| bool | isPlayerInRoom (const Room *room) const override |
| Tells if this user is a player in the given Room. | |
| bool | isSpectatorInRoom (const Room *room) const override |
| Tells if this user is a spectator in the given Room. | |
| bool | isJoinedInRoom (const Room *room) const override |
| Tells if this user joined the given Room. | |
| int32_t | getPrivilegeId () const override |
| Returns the id of the privilege level of this user. | |
| core::UserManager * | getUserManager () const override |
| bool | isGuest () const override |
| Tells if this user logged in as a guest or not. | |
| bool | isStandardUser () const override |
| Tells if this user logged in as a standard user or not. | |
| bool | isModerator () const override |
| Tells if this user logged in as a moderator or not. | |
| bool | isAdmin () const override |
| Tells if this user logged in as an administrator or not. | |
| bool | isItMe () const override |
| Tells if this User object represents the current client. | |
| std::vector< std::shared_ptr< UserVariable > > | getVariables () const override |
| std::shared_ptr< UserVariable > | getVariable (const std::string &varName) const override |
| Retrieves a User Variable from its name. | |
| bool | containsVariable (const std::string &name) const override |
| Tells if this user has the given User Variable set or not. | |
| std::optional< Vec3D > | getAOIEntryPoint () const override |
| Returns the point inside the current user's Area of Interest where this user "appeared" with the last proximity list update, in an MMORoom. | |
The standard implementation of User: a client logged in SmartFoxServer.
The client API does not know every user connected to the server, but only the ones inside the Rooms the current client joined. This keeps the traffic between client and server much lower. To interact with other users, join more Rooms or use the Buddy List system to follow your friends.
|
inlineoverridevirtual |
Implements sfs3::entities::User.
|
inlineoverridevirtual |
Implements sfs3::entities::User.
|
overridevirtual |
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.
Implements sfs3::entities::User.
|
overridevirtual |
Returns the player id of this user in the given Room.
| room | The Room to read the player id from. |
Implements sfs3::entities::User.
|
overridevirtual |
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.
Implements sfs3::entities::User.
|
overridevirtual |
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.
Implements sfs3::entities::User.
|
overridevirtual |
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.Implements sfs3::entities::User.
|
overridevirtual |
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.Implements sfs3::entities::User.
|
overridevirtual |
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. Implements sfs3::entities::User.
|
inlineoverridevirtual |
Returns the id of the privilege level of this user.
The server assigns the privileges to the user when he logs in.
Implements sfs3::entities::User.
|
inlineoverridevirtual |
Implements sfs3::entities::User.
|
overridevirtual |
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 guestImplements sfs3::entities::User.
|
overridevirtual |
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 userImplements sfs3::entities::User.
|
overridevirtual |
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 moderatorImplements sfs3::entities::User.
|
overridevirtual |
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 administratorImplements sfs3::entities::User.
|
inlineoverridevirtual |
Tells if this User object represents the current client.
true if this is the current clientImplements sfs3::entities::User.
|
overridevirtual |
Implements sfs3::entities::User.
|
overridevirtual |
Retrieves a User Variable from its name.
Implements sfs3::entities::User.
|
overridevirtual |
|
inlineoverridevirtual |
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.
Implements sfs3::entities::User.