SmartFoxServer 2X C++ API
|
The User object represent a client logged in the Server. More...
#include <SFSUser.h>
Public Member Functions | |
long int | Id () |
Get the unique User Id More... | |
boost::shared_ptr< string > | Name () |
The user name More... | |
long int | PlayerId () |
Get the playerId of the User. More... | |
bool | IsPlayer () |
Return true if the User is a Player (playerId > 0) in the last joined Room More... | |
bool | IsSpectator () |
Return true if the User is a Spectator (playerId < 0) in the last joined Room More... | |
long int | GetPlayerId (boost::shared_ptr< Room > room) |
Return the playerId for the specific Room. More... | |
long int | PrivilegeId () |
Get the privilegeId of the User More... | |
void | PrivilegeId (long int value) |
Get the privilegeId of the User More... | |
boost::shared_ptr< IUserManager > | UserManager () |
Get the UserManager of this User More... | |
void | UserManager (boost::shared_ptr< IUserManager > value) |
Get the UserManager of this User More... | |
boost::shared_ptr< Vec3D > | AOIEntryPoint () |
Returns the entry point of this user in the current user's AoI. | |
void | AOIEntryPoint (boost::shared_ptr< Vec3D > value) |
Returns the entry point of this user in the current user's AoI. | |
bool | IsGuest () |
Return true if the User is logged in as guest user More... | |
bool | IsStandardUser () |
Return true if the User is logged in as standard user More... | |
bool | IsModerator () |
Return true if the User is logged in as moderator user More... | |
bool | IsAdmin () |
Return true if the User is logged in as administrator user More... | |
bool | IsPlayerInRoom (boost::shared_ptr< Room > room) |
Return true if the User is a Player in the specified Room More... | |
bool | IsSpectatorInRoom (boost::shared_ptr< Room > room) |
Return true if the User is a Spectator in the specified Room More... | |
bool | IsJoinedInRoom (boost::shared_ptr< Room > room) |
Return true if the User is joined in the specified Room More... | |
bool | IsItMe () |
Return true if the User object is the client's User object, also known as SmartFox.MySelf More... | |
boost::shared_ptr< vector< boost::shared_ptr< UserVariable > > > | GetVariables () |
Get all the User Variables More... | |
boost::shared_ptr< UserVariable > | GetVariable (string varName) |
Get a UserVariable More... | |
bool | ContainsVariable (string name) |
Check if a UserVariable exists More... | |
boost::shared_ptr< map< string, boost::shared_ptr< void > > > | Properties () |
A generic object that can be used to store any User custom data needed at runtime. More... | |
void | Properties (boost::shared_ptr< map< string, boost::shared_ptr< void > > > value) |
A generic object that can be used to store any User custom data needed at runtime. More... | |
The User object represent a client logged in the Server.
The client API don't know about all Users connected to the server side but only about those that are in the same Rooms where the client is joined.
In order to interact with other Users the client can join different Rooms or use a BuddyList to keep track of and interact with his friends.
|
virtual |
Check if a UserVariable exists
name | the name of the variable |
Implements Sfs2X::Entities::User.
|
virtual |
Return the playerId for the specific Room.
If you don't use multi-room you can use User.PlayerId
room | Pointer to a Room instance |
Implements Sfs2X::Entities::User.
|
virtual |
Get a UserVariable
varName | the name of the variable |
Implements Sfs2X::Entities::User.
|
virtual |
Get all the User Variables
Implements Sfs2X::Entities::User.
|
virtual |
Get the unique User Id
Implements Sfs2X::Entities::User.
|
virtual |
Return true if the User is logged in as administrator user
Implements Sfs2X::Entities::User.
|
virtual |
Return true if the User is logged in as guest user
Implements Sfs2X::Entities::User.
|
virtual |
Return true if the User object is the client's User object, also known as SmartFox.MySelf
Implements Sfs2X::Entities::User.
|
virtual |
Return true if the User is joined in the specified Room
room | Pointer to a Room instance |
Implements Sfs2X::Entities::User.
|
virtual |
Return true if the User is logged in as moderator user
Implements Sfs2X::Entities::User.
|
virtual |
Return true if the User is a Player (playerId > 0) in the last joined Room
Non game Rooms will always return false
Implements Sfs2X::Entities::User.
|
virtual |
Return true if the User is a Player in the specified Room
room | Pointer to a Room instance |
Implements Sfs2X::Entities::User.
|
virtual |
Return true if the User is a Spectator (playerId < 0) in the last joined Room
Non game Rooms will always return false
Implements Sfs2X::Entities::User.
|
virtual |
Return true if the User is a Spectator in the specified Room
room | Pointer to a Room instance |
Implements Sfs2X::Entities::User.
|
virtual |
Return true if the User is logged in as standard user
Implements Sfs2X::Entities::User.
|
virtual |
The user name
Implements Sfs2X::Entities::User.
|
virtual |
Get the playerId of the User.
The playerId is different from the User ID and it used to indicate which player number is the user inside a Game Room. Example: in a Game Room for 5 players the first client joining will have playerId = 1, the 2nd will have playerId = 2 and so forth. When a User leaves the Room its player slot is freed up and the next User joining the Room will take it.
The playerId is only applicable for Game Rooms, in the other Rooms it is always == 0 A playerId < 0 indicates that the User is a spectator.
If the User is joined in multiple game Rooms at the same time he will be assigned one playerId per Room. In order to obtain a specific playerId you can use the User.GetPlayerId(Room room)
method.
Implements Sfs2X::Entities::User.
|
virtual |
|
virtual |
|
virtual |
A generic object that can be used to store any User custom data needed at runtime.
The values added/removed in this object are for client side use only an are never transmitted to the Server.
Implements Sfs2X::Entities::User.
|
virtual |
A generic object that can be used to store any User custom data needed at runtime.
The values added/removed in this object are for client side use only an are never transmitted to the Server.
Implements Sfs2X::Entities::User.
|
virtual |
|
virtual |