# INFSmartFoxUser Class Reference

List of all members.

## Public Member Functions
(void) | - clearVariables
(int) | - getId
(NSString *) | - getName
(NSInteger) | - getPlayerId
(id) | - getVariable:
(NSMutableDictionary *) | - getVariables
(id) | - initWithParams:name:
(BOOL) | - isModerator
(BOOL) | - isSpectator
(void) | - setIsSpectator:
(void) | - setModerator:
(void) | - setPlayerId:
(void) | - setVariables:
## Static Public Member Functions
(id) | + user:name:

## Detailed Description

The User class stores the properties of each user. This class is used internally by the INFSmartFoxiPhoneClient class; also, User objects are returned by various methods and events of the SmartFoxServer API.

NOTE: in the provided examples, user always indicates a User instance.

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  1.0.0

## Member Function Documentation

- (void) clearVariables |  |  |  |

Reset User Variabless.

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

- (int) getId |  |  |  |

Get the id of the user.

Returns:
  The user id.

See also:
  - getName

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (NSString *) getName |  |  |  |

Get the name of the user.

Returns:
  The user name.

See also:
  - getId

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (NSInteger) getPlayerId |  |  |  |

Retrieve the player id of the user. The user must be a player inside a game room for this method to work properly. This id is 1-based (player 1, player 2, etc.), but if the user is a spectator its value is -1.

Returns:
  The current player id.

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (id) getVariable: |  | (NSString *) | varName |  |

Retrieve a User Variable.

Parameters:

  | varName | : the name of the variable to retrieve.

Returns:
  The User Variable's value.

See also:
  - getVariables

  - setUserVariables:roomId: (INFSmartFoxiPhoneClient)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (NSMutableDictionary *) getVariables |  |  |  |

Retrieve the list of all User Variables.

Returns:
  An associative array containing User Variables' values, where the key is the variable name.

See also:
  - getVariable:

  - setUserVariables:roomId: (INFSmartFoxiPhoneClient)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (id) initWithParams: |  | (NSInteger) | id
name: |  | (NSString *) | name |

- (BOOL) isModerator |  |  |  |

A boolean flag indicating if the user is a Moderator in the current zone.

Returns:
  true if the user is a Moderator.

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (BOOL) isSpectator |  |  |  |

A boolean flag indicating if the user is a spectator in the current room.

Returns:
  true if the user is a spectator.

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (void) setIsSpectator: |  | (BOOL) | b |  |

Set the INFSmartFoxUser#isSpectator property.

Parameters:

  | b | : true if the user is a spectator.

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

- (void) setModerator: |  | (BOOL) | b |  |

Set the INFSmartFoxUser#isModerator property.

Parameters:

  | b | : true if the user is a Moderator.

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

- (void) setPlayerId: |  | (NSInteger) | pid |  |

Set the playerId property.

Parameters:

  | pid | : the playerId value.

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

- (void) setVariables: |  | (NSDictionary *) | o |  |

Set the User Variabless.

Parameters:

  | o | : an object containing variables' key-value pairs.

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

+ (id) user: |  | (NSInteger) | id
name: |  | (NSString *) | name |

User contructor.

Parameters:

  | id | : the user id.
  | name | : the user name.

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com