Package | com.smartfoxserver.v2.entities |
Interface | public interface User |
Implementors | SFSUser |
In the SmartFoxServer 2X client API this interface is implemented by the SFSUser class. Read the class description for additional informations.
See also
Property | Defined By | ||
---|---|---|---|
aoiEntryPoint : Vec3D
Returns the entry point of this user in the current user's AoI. | User | ||
id : int [read-only]
Indicates the id of this user. | User | ||
isItMe : Boolean [read-only]
Indicates if this User object represents the current client. | User | ||
isPlayer : Boolean [read-only]
Indicates whether this user is a player (playerId greater than 0) in the last joined Room or not. | User | ||
isSpectator : Boolean [read-only]
Indicates whether this user is a spectator (playerId lower than 0) in the last joined Room or not. | User | ||
name : String [read-only]
Indicates the name of this user. | User | ||
playerId : int [read-only]
Returns the id of this user as a player in a Game Room. | User | ||
privilegeId : int
Returns the id which identifies the privilege level of this user. | User | ||
properties : Object
Defines a generic utility object that can be used to store custom user data. | User | ||
userManager : IUserManager
Returns a reference to the User Manager which manages this user. | User |
Method | Defined By | ||
---|---|---|---|
containsVariable(name:String):Boolean
Indicates whether this user has the specified User Variable set or not. | User | ||
getPlayerId(room:Room):int
Returns the playerId value of this user in the passed Room. | User | ||
getVariable(name:String):UserVariable
Retrieves a User Variable from its name. | User | ||
getVariables():Array
Retrieves all the User Variables of this user. | User | ||
isAdmin():Boolean
Indicates whether this user logged in as an administrator or not. | User | ||
isGuest():Boolean
Indicates whether this user logged in as a guest or not. | User | ||
isJoinedInRoom(room:Room):Boolean
Indicates whether this user joined the passed Room or not. | User | ||
isModerator():Boolean
Indicates whether this user logged in as a moderator or not. | User | ||
isPlayerInRoom(room:Room):Boolean
Indicates whether this user is a player (playerId greater than 0) in the passed Room or not. | User | ||
isSpectatorInRoom(room:Room):Boolean
Indicates whether this user is a spectator (playerId lower than 0) in the passed Room or not. | User | ||
isStandardUser():Boolean
Indicates whether this user logged in as a standard user or not. | User |
aoiEntryPoint | property |
aoiEntryPoint:Vec3D
Returns the entry point of this user in the current user's AoI.
The returned coordinates are those that the user had when his presence in the current user's Area of Interest was last notified by a SFSEvent.PROXIMITY_LIST_UPDATE event. This field is populated only if the user joined a Room of type MMORoom and this is configured to receive such data from the server.
public function get aoiEntryPoint():Vec3D
public function set aoiEntryPoint(value:Vec3D):void
See also
id | property |
id:int
[read-only] Indicates the id of this user. It is unique and it is generated by the server when the user is created.
public function get id():int
isItMe | property |
isItMe:Boolean
[read-only] Indicates if this User object represents the current client.
public function get isItMe():Boolean
See also
isPlayer | property |
isPlayer:Boolean
[read-only]
Indicates whether this user is a player (playerId greater than 0
) in the last joined Room or not.
Non-Game Rooms always return false
.
If the user is inside multiple Game Rooms at the same time, use the isPlayerInRoom() method.
public function get isPlayer():Boolean
See also
isSpectator | property |
isSpectator:Boolean
[read-only]
Indicates whether this user is a spectator (playerId lower than 0
) in the last joined Room or not.
Non-Game Rooms always return false
.
If the user is inside multiple Game Rooms at the same time, use the isSpectatorInRoom() method.
public function get isSpectator():Boolean
See also
name | property |
name:String
[read-only] Indicates the name of this user. Two users in the same Zone can't have the same name.
public function get name():String
playerId | property |
playerId:int
[read-only] Returns the id of this user as a player in a Game Room.
This property differs from id property and it used to indicate which player number is assigned to a user inside a Game Room.
For example, in a Game Room for 5 players the first client joining it will have playerId equal to 1
, the second will have it equal to 2
and so forth.
When a user leaves the Room the player slot is freed up and the next user joining the Room will take it.
The playerId property applies to Game Rooms only; in standard Rooms it is always 0
.
Also, in Game Rooms a playerId value lower than 0
indicates that the user is a spectator.
If the user is inside multiple Game Rooms at the same time, a different playerId value will be assigned to him in each Room. In this case this property returns the value corresponding to the last joined Room; in order to obtain the playerId value in a specific Room, use the getPlayerId() method.
public function get playerId():int
See also
privilegeId | property |
privilegeId:int
Returns the id which identifies the privilege level of this user.
NOTE: setting the privilegeId property manually has no effect on the server and can disrupt the API functioning. Privileges are assigned to the user by the server when the user logs in.
public function get privilegeId():int
public function set privilegeId(value:int):void
See also
properties | property |
properties:Object
Defines a generic utility object that can be used to store custom user data. The values added to this object are for client-side use only and are never transmitted to the server or to the other clients.
public function get properties():Object
public function set properties(value:Object):void
userManager | property |
userManager:IUserManager
Returns a reference to the User Manager which manages this user.
NOTE: setting the userManager property manually has no effect on the server and can disrupt the API functioning.
public function get userManager():IUserManager
public function set userManager(value:IUserManager):void
containsVariable | () | method |
public function containsVariable(name:String):Boolean
Indicates whether this user has the specified User Variable set or not.
Parameters
name:String — The name of the User Variable whose existance must be checked.
|
Boolean — true if a User Variable with the passed name is set for this user.
|
getPlayerId | () | method |
public function getPlayerId(room:Room):int
Returns the playerId value of this user in the passed Room. See the playerId property description for more informations.
Parameters
room:Room — The Room object representing the Room to retrieve the player id from.
|
int — The playerId of this user in the passed Room.
|
See also
getVariable | () | method |
public function getVariable(name:String):UserVariable
Retrieves a User Variable from its name.
Parameters
name:String — The name of the User Variable to be retrieved.
|
UserVariable — The UserVariable object representing the User Variable, or null if no User Variable with the passed name is associated with this user.
|
See also
getVariables | () | method |
public function getVariables():Array
Retrieves all the User Variables of this user.
ReturnsArray — The list of UserVariable objects associated with the user.
|
See also
isAdmin | () | method |
public function isAdmin():Boolean
Indicates whether this user logged in as an administrator or not. Administrator users have the privilegeId property set to UserPrivileges.ADMINISTRATOR.
ReturnsBoolean — true if this user is an administrator.
|
See also
isGuest | () | method |
public function isGuest():Boolean
Indicates whether this user logged in as a guest or not. Guest users have the privilegeId property set to UserPrivileges.GUEST.
ReturnsBoolean — true if this user is a guest.
|
See also
isJoinedInRoom | () | method |
public function isJoinedInRoom(room:Room):Boolean
Indicates whether this user joined the passed Room or not.
Parameters
room:Room — The Room object representing the Room where to check the user presence.
|
Boolean — true if this user is inside the passed Room.
|
isModerator | () | method |
public function isModerator():Boolean
Indicates whether this user logged in as a moderator or not. Moderator users have the privilegeId property set to UserPrivileges.MODERATOR.
ReturnsBoolean — true if this user is a moderator.
|
See also
isPlayerInRoom | () | method |
public function isPlayerInRoom(room:Room):Boolean
Indicates whether this user is a player (playerId greater than 0
) in the passed Room or not.
Non-Game Rooms always return false
.
If a user can join one Game Room at a time only, use the isPlayer property.
Parameters
room:Room — The Room object representing the Room where to check if this user is a player.
|
Boolean — true if this user is a player in the passed Room.
|
See also
isSpectatorInRoom | () | method |
public function isSpectatorInRoom(room:Room):Boolean
Indicates whether this user is a spectator (playerId lower than 0
) in the passed Room or not.
Non-Game Rooms always return false
.
If a user can join one Game Room at a time only, use the isSpectator property.
Parameters
room:Room — The Room object representing the Room where to check if this user is a spectator.
|
Boolean — true if this user is a spectator in the passed Room.
|
See also
isStandardUser | () | method |
public function isStandardUser():Boolean
Indicates whether this user logged in as a standard user or not. Standard users have the privilegeId property set to UserPrivileges.STANDARD.
ReturnsBoolean — true if this user is a standard user.
|
See also