Public Member Functions | |
| (void) | - addUser:id: |
| (void) | - clearUserList |
| (void) | - clearVariables |
| (NSInteger) | - getId |
| (NSInteger) | - getMaxSpectators |
| (NSInteger) | - getMaxUsers |
| (NSInteger) | - getMyPlayerIndex |
| (NSString *) | - getName |
| (NSInteger) | - getSpectatorCount |
| (INFSmartFoxUser *) | - getUser: |
| (NSInteger) | - getUserCount |
| (NSMutableDictionary *) | - getUserList |
| (id) | - getVariable: |
| (NSMutableDictionary *) | - getVariables |
| (id) | - initWithParams:name:maxUsers:maxSpectators:isTemp:isGame:isPrivate:isLimbo:userCount:specCount: |
| (BOOL) | - isGame |
| (BOOL) | - isLimbo |
| (BOOL) | - isPrivate |
| (BOOL) | - isTemp |
| (void) | - removeUser: |
| (void) | - setIsLimbo: |
| (void) | - setMyPlayerIndex: |
| (void) | - setSpectatorCount: |
| (void) | - setUserCount: |
| (void) | - setVariables: |
Static Public Member Functions | |
| (id) | + room:name:maxUsers:maxSpectators:isTemp:isGame:isPrivate:isLimbo:userCount:specCount: |
NOTE: in the provided examples, room always indicates a Room instance.
| - (void) addUser: | (INFSmartFoxUser *) | u | ||
| id: | (NSInteger) | id | ||
| - (void) clearUserList |
Reset users list.
| - (void) clearVariables |
Reset Room Variables.
| - (NSInteger) getId |
Get the id of the room.
| - (NSInteger) getMaxSpectators |
Retrieve the maximum number of spectators that can join the room. Spectators can exist in game rooms only.
| - (NSInteger) getMaxUsers |
Retrieve the maximum number of users that can join the room.
| - (NSInteger) getMyPlayerIndex |
Retrieve the player id for the current user in the room. This id is 1-based (player 1, player 2, etc.), but if the user is a spectator its value is -1.
| - (NSString *) getName |
Get the name of the room.
| - (NSInteger) getSpectatorCount |
Retrieve the number of spectators currently inside the room.
| - (INFSmartFoxUser *) getUser: | (id) | userId |
Retrieve a user currently in the room.
| userId | : the user name (String) or the id (int) of the user to retrieve. |
| - (NSInteger) getUserCount |
Retrieve the number of users currently inside the room.
| - (NSMutableDictionary *) getUserList |
Get the list of users currently inside the room. As the returned list is an associative array with user id(s) as keys, in order to iterate it a for-in loop or a for-each loop should be used.
| - (id) getVariable: | (NSString *) | varName |
Retrieve a Room Variable.
| varName | : the name of the variable to retrieve. |
| - (NSMutableDictionary *) getVariables |
Retrieve the list of all Room Variables.
| - (id) initWithParams: | (NSInteger) | id | ||
| name: | (NSString *) | name | ||
| maxUsers: | (NSInteger) | maxUsers | ||
| maxSpectators: | (NSInteger) | maxSpectators | ||
| isTemp: | (BOOL) | isTemp | ||
| isGame: | (BOOL) | isGame | ||
| isPrivate: | (BOOL) | isPrivate | ||
| isLimbo: | (BOOL) | isLimbo | ||
| userCount: | (NSInteger) | userCount | ||
| specCount: | (NSInteger) | specCount | ||
| - (BOOL) isGame |
A boolean flag indicating if the room is a "game room".
| - (BOOL) isLimbo |
A boolean flag indicating if the room is in "limbo mode".
| - (BOOL) isPrivate |
A boolean flag indicating if the room is private (password protected).
| - (BOOL) isTemp |
A boolean flag indicating if the room is dynamic/temporary. This is always true for rooms created at runtime on client-side.
| - (void) removeUser: | (NSInteger) | id |
Remove a user from the room.
| id | : the user id. |
| + (id) room: | (NSInteger) | id | ||
| name: | (NSString *) | name | ||
| maxUsers: | (NSInteger) | maxUsers | ||
| maxSpectators: | (NSInteger) | maxSpectators | ||
| isTemp: | (BOOL) | isTemp | ||
| isGame: | (BOOL) | isGame | ||
| isPrivate: | (BOOL) | isPrivate | ||
| isLimbo: | (BOOL) | isLimbo | ||
| userCount: | (NSInteger) | userCount | ||
| specCount: | (NSInteger) | specCount | ||
Room contructor.
| id | : the room id. | |
| name | : the room name. | |
| maxUsers | : the maximum number of users that can join the room simultaneously. | |
| maxSpectators | : the maximum number of spectators in the room (for game rooms only). | |
| isTemp | : true if the room is temporary. | |
| isGame | : true if the room is a "game room". | |
| isPrivate | : true if the room is private (password protected). | |
| isLimbo | : true if the room is a "limbo room". | |
| userCount | ||
| specCount |
| - (void) setIsLimbo: | (BOOL) | b |
| - (void) setMyPlayerIndex: | (NSInteger) | id |
Set the myPlayerId property. Each room where the current client is connected contains a myPlayerId (if the room is a gameRoom). myPlayerId == -1 ... user is a spectator myPlayerId > 0 ... user is a player
| id | : the myPlayerId value. |
| - (void) setSpectatorCount: | (NSInteger) | n |
Se the number of spectators in the room.
| n | : the number of spectators. |
| - (void) setUserCount: | (NSInteger) | n |
Se the number of users in the room.
| n | : the number of users. |
| - (void) setVariables: | (NSDictionary *) | vars |
Set the Room Variables.
| vars | : an array of Room Variables. |
1.5.8