SFSRoom Class Reference
Inherits from | NSObject |
Conforms to | Room |
Declared in | SFSRoom.h SFSRoom.m |
Overview
The Room object that represents a server Room.
The client API don’t know about all Rooms on the server side but only about those that are joined and those in the Room Groups that were subscribed.
Subscribing to one or more Group allows the client to listen for Room events in specific “areas” of the Zone without having to know and download details for all Rooms available.
The RoomList is created after a succesful login in the SmartFox2XClient roomList object and it is kept updated at all times by the Server.
See [SmartFox2XClient roomList], CreateRoomRequest, JoinRoomRequest, SubscribeRoomGroupRequest, UnsubscribeRoomGroupRequest, ChangeRoomNameRequest, ChangeRoomPasswordStateRequest, ChangeRoomCapacityRequest
Tasks
-
id
The unique id of the Room
property -
name
The Room name
property -
groupId
The Room Group. Each Room is assigned to its Group. By default SmartFoxServer uses one single group called default
property -
isGame
Determines if a Room is a Game Room
property -
isHidden
Determines if the Room is hidden
property -
isJoined
Returns true if the Room is joined by the current User
property -
isPasswordProtected
Returns true if the Room requires a password for joining it
property -
isManaged
@cond
property -
maxUsers
Get the maximum number of users allowed for this Room
property -
maxSpectators
Get the maximum number of spectators allowed in the Room
property -
userCount
Get the current number of users
property -
capacity
Returns the max amount of users (both Users and Spectators) that can be contained in this room
property -
spectatorCount
Get the number of spectators (only for Game Rooms)
property -
properties
The properties object can be used to store any custom value/object to the Room at runtime
property -
roomManager
@cond
property -
userList
Get the full list of users in the Room
property -
playerList
Returns all the Users that are players in this Room (must be Game Room)
property -
spectatorList
Returns all the Users that are spectators in this Room (must be Game Room)
property -
– initWithId:name:groupId:
@cond
-
– getVariables
Returns all the Room Variables
-
– getVariable:
Get a Room Variable
-
– getUserByName:
Get a User from its name
-
– getUserById:
Get a User from its ID
-
– containsVariable:
Check for the presence of a Room Variable
-
– containsUser:
Checks if a User is joined in this Room
Properties
capacity
Returns the max amount of users (both Users and Spectators) that can be contained in this room
@property (nonatomic, readonly) NSInteger capacity
Discussion
Returns the max amount of users (both Users and Spectators) that can be contained in this room
Declared In
SFSRoom.h
groupId
The Room Group. Each Room is assigned to its Group. By default SmartFoxServer uses one single group called default
@property (nonatomic, readonly) NSString *groupId
Discussion
The Room Group. Each Room is assigned to its Group. By default SmartFoxServer uses one single group called default
Declared In
SFSRoom.h
id
The unique id of the Room
@property (nonatomic, readonly) NSInteger id
Discussion
The unique id of the Room
Declared In
SFSRoom.h
isGame
Determines if a Room is a Game Room
@property (nonatomic, assign) BOOL isGame
Discussion
Determines if a Room is a Game Room
Declared In
SFSRoom.h
isHidden
Determines if the Room is hidden
@property (nonatomic, assign) BOOL isHidden
Discussion
Determines if the Room is hidden
Declared In
SFSRoom.h
isJoined
Returns true if the Room is joined by the current User
@property (nonatomic, assign) BOOL isJoined
Discussion
Returns true if the Room is joined by the current User
Declared In
SFSRoom.h
isPasswordProtected
Returns true if the Room requires a password for joining it
@property (nonatomic, assign) BOOL isPasswordProtected
Discussion
Returns true if the Room requires a password for joining it
Declared In
SFSRoom.h
maxSpectators
Get the maximum number of spectators allowed in the Room
@property (nonatomic, assign) NSInteger maxSpectators
Discussion
Get the maximum number of spectators allowed in the Room
Declared In
SFSRoom.h
maxUsers
Get the maximum number of users allowed for this Room
@property (nonatomic, assign) NSInteger maxUsers
Discussion
Get the maximum number of users allowed for this Room
Declared In
SFSRoom.h
name
The Room name
@property (nonatomic, retain) NSString *name
Discussion
The Room name
Declared In
SFSRoom.h
playerList
Returns all the Users that are players in this Room (must be Game Room)
@property (nonatomic, readonly) NSArray *playerList
Discussion
Returns all the Users that are players in this Room (must be Game Room)
Declared In
SFSRoom.h
properties
The properties object can be used to store any custom value/object to the Room at runtime
@property (nonatomic, retain) NSDictionary *properties
Discussion
The properties object can be used to store any custom value/object to the Room at runtime
Declared In
SFSRoom.h
roomManager
@cond
@property (nonatomic, assign) id<> roomManager
Discussion
@cond
Declared In
SFSRoom.h
spectatorCount
Get the number of spectators (only for Game Rooms)
@property (nonatomic, assign) NSInteger spectatorCount
Discussion
Get the number of spectators (only for Game Rooms)
Declared In
SFSRoom.h
spectatorList
Returns all the Users that are spectators in this Room (must be Game Room)
@property (nonatomic, readonly) NSArray *spectatorList
Discussion
Returns all the Users that are spectators in this Room (must be Game Room)
Declared In
SFSRoom.h
Instance Methods
containsUser:
Checks if a User is joined in this Room
- (BOOL)containsUser:(id<User>)user
Return Value
true if the User exists in the Room
Discussion
Checks if a User is joined in this Room
Declared In
SFSRoom.h
containsVariable:
Check for the presence of a Room Variable
- (BOOL)containsVariable:(NSString *)name
Return Value
true if the the Room Variable exists
Discussion
Check for the presence of a Room Variable
Declared In
SFSRoom.h
getUserById:
Get a User from its ID
- (id<User>)getUserById:(NSInteger)id
Return Value
the User, or null if no User with that ID exists in the Room
Discussion
Get a User from its ID
Declared In
SFSRoom.h
getUserByName:
Get a User from its name
- (id<User>)getUserByName:(NSString *)name
Return Value
the User, or null if no User with that name exists in the Room
Discussion
Get a User from its name
Declared In
SFSRoom.h
getVariable:
Get a Room Variable
- (id<RoomVariable>)getVariable:(NSString *)name
Parameters
- name
the name of the variable
Return Value
the Room Variable, or null if no variable exists with that name
Discussion
Get a Room Variable
Declared In
SFSRoom.h