User Protocol Reference
| Conforms to | NSObject | 
| Declared in | User.h | 
Tasks
- 
	
		– idGet the unique User Id required method
- 
	
		– nameThe user name required method
- 
	
		– playerIdGet the playerId of the User. required method
- 
	
		– isPlayerReturn true if the User is a Player (playerId > 0) in the last joined Room (non game Rooms will always return false) required method
- 
	
		– isSpectatorReturn true if the User is a Spectator (playerId < 0) in the last joined Room (non game Rooms will always return false) required method
- 
	
		– getPlayerId:Return the playerId for the specific Room. If you don’t use multi-room you can use playerId required method
- 
	
		– privilegeIdGet the privilegeId of the User required method
- 
	
		– userManagerGet the UserManager of this User required method
- 
	
		– isGuestReturn true if the User is logged in as guest user required method
- 
	
		– isStandardUserReturn true if the User is logged in as standard user required method
- 
	
		– isModeratorReturn true if the User is logged in as moderator user required method
- 
	
		– isAdminReturn true if the User is logged in as administrator user required method
- 
	
		– isPlayerInRoom:Return true if the User is a Player in the specified Room required method
- 
	
		– isSpectatorInRoom:Return true if the User is a Spectator in the specified Room required method
- 
	
		– isJoinedInRoom:Return true if the User is joined in the specified Room required method
- 
	
		– isItMeReturn true if the User object is the client’s User object, also known as SmartFox2XClient.mySelf required method
- 
	
		– getVariablesGet all the User Variables required method
- 
	
		– getVariable:Get a UserVariable required method
- 
	
		– containsVariable:Check if a UserVariable exists required method
- 
	
		– propertiesA 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. required method
Instance Methods
containsVariable:
Check if a UserVariable exists
- (BOOL)containsVariable:(NSString *)nameParameters
- name
- : the name of the variable 
Return Value
true if the UserVariable exists
Discussion
Check if a UserVariable exists
See Also
Declared In
User.hgetPlayerId:
Return the playerId for the specific Room. If you don’t use multi-room you can use playerId
- (NSInteger)getPlayerId:(id<Room>)roomDiscussion
Return the playerId for the specific Room. If you don’t use multi-room you can use playerId
See Also
Declared In
User.hgetVariable:
Get a UserVariable
- (id<UserVariable>)getVariable:(NSString *)varNameParameters
- varName
- : the name of the variable 
Return Value
the UserVariable or null if the variable doesn’t exist
Discussion
Get a UserVariable
See Also
Declared In
User.hgetVariables
Get all the User Variables
- (NSArray *)getVariablesDiscussion
Get all the User Variables
See Also
Declared In
User.hisAdmin
Return true if the User is logged in as administrator user
- (BOOL)isAdminDiscussion
Return true if the User is logged in as administrator user
Declared In
User.hisGuest
Return true if the User is logged in as guest user
- (BOOL)isGuestDiscussion
Return true if the User is logged in as guest user
Declared In
User.hisItMe
Return true if the User object is the client’s User object, also known as SmartFox2XClient.mySelf
- (BOOL)isItMeDiscussion
Return true if the User object is the client’s User object, also known as SmartFox2XClient.mySelf
Declared In
User.hisJoinedInRoom:
Return true if the User is joined in the specified Room
- (BOOL)isJoinedInRoom:(id<Room>)roomDiscussion
Return true if the User is joined in the specified Room
Declared In
User.hisModerator
Return true if the User is logged in as moderator user
- (BOOL)isModeratorDiscussion
Return true if the User is logged in as moderator user
Declared In
User.hisPlayer
Return true if the User is a Player (playerId > 0) in the last joined Room (non game Rooms will always return false)
- (BOOL)isPlayerDiscussion
Return true if the User is a Player (playerId > 0) in the last joined Room (non game Rooms will always return false)
See Also
- lastJoinedRoom 
Declared In
User.hisPlayerInRoom:
Return true if the User is a Player in the specified Room
- (BOOL)isPlayerInRoom:(id<Room>)roomDiscussion
Return true if the User is a Player in the specified Room
Declared In
User.hisSpectator
Return true if the User is a Spectator (playerId < 0) in the last joined Room (non game Rooms will always return false)
- (BOOL)isSpectatorDiscussion
Return true if the User is a Spectator (playerId < 0) in the last joined Room (non game Rooms will always return false)
See Also
- lastJoinedRoom 
Declared In
User.hisSpectatorInRoom:
Return true if the User is a Spectator in the specified Room
- (BOOL)isSpectatorInRoom:(id<Room>)roomDiscussion
Return true if the User is a Spectator in the specified Room
Declared In
User.hisStandardUser
Return true if the User is logged in as standard user
- (BOOL)isStandardUserDiscussion
Return true if the User is logged in as standard user
Declared In
User.hplayerId
Get the playerId of the User.
- (NSInteger)playerIdDiscussion
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 [id User getPlayerId:room] method.
Declared In
User.hprivilegeId
Get the privilegeId of the User
- (NSInteger)privilegeIdDiscussion
Get the privilegeId of the User
See Also
Declared In
User.hproperties
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.
- (NSMutableDictionary *)propertiesDiscussion
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.
Declared In
User.h