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
-
idThe unique id of the Room
property -
nameThe Room name
property -
groupIdThe Room Group. Each Room is assigned to its Group. By default SmartFoxServer uses one single group called default
property -
isGameDetermines if a Room is a Game Room
property -
isHiddenDetermines if the Room is hidden
property -
isJoinedReturns true if the Room is joined by the current User
property -
isPasswordProtectedReturns true if the Room requires a password for joining it
property -
isManaged@cond
property -
maxUsersGet the maximum number of users allowed for this Room
property -
maxSpectatorsGet the maximum number of spectators allowed in the Room
property -
userCountGet the current number of users
property -
capacityReturns the max amount of users (both Users and Spectators) that can be contained in this room
property -
spectatorCountGet the number of spectators (only for Game Rooms)
property -
propertiesThe properties object can be used to store any custom value/object to the Room at runtime
property -
roomManager@cond
property -
userListGet the full list of users in the Room
property -
playerListReturns all the Users that are players in this Room (must be Game Room)
property -
spectatorListReturns all the Users that are spectators in this Room (must be Game Room)
property -
– initWithId:name:groupId:@cond
-
– getVariablesReturns 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 capacityDiscussion
Returns the max amount of users (both Users and Spectators) that can be contained in this room
Declared In
SFSRoom.hgroupId
The Room Group. Each Room is assigned to its Group. By default SmartFoxServer uses one single group called default
@property (nonatomic, readonly) NSString *groupIdDiscussion
The Room Group. Each Room is assigned to its Group. By default SmartFoxServer uses one single group called default
Declared In
SFSRoom.hid
The unique id of the Room
@property (nonatomic, readonly) NSInteger idDiscussion
The unique id of the Room
Declared In
SFSRoom.hisGame
Determines if a Room is a Game Room
@property (nonatomic, assign) BOOL isGameDiscussion
Determines if a Room is a Game Room
Declared In
SFSRoom.hisHidden
Determines if the Room is hidden
@property (nonatomic, assign) BOOL isHiddenDiscussion
Determines if the Room is hidden
Declared In
SFSRoom.hisJoined
Returns true if the Room is joined by the current User
@property (nonatomic, assign) BOOL isJoinedDiscussion
Returns true if the Room is joined by the current User
Declared In
SFSRoom.hisPasswordProtected
Returns true if the Room requires a password for joining it
@property (nonatomic, assign) BOOL isPasswordProtectedDiscussion
Returns true if the Room requires a password for joining it
Declared In
SFSRoom.hmaxSpectators
Get the maximum number of spectators allowed in the Room
@property (nonatomic, assign) NSInteger maxSpectatorsDiscussion
Get the maximum number of spectators allowed in the Room
Declared In
SFSRoom.hmaxUsers
Get the maximum number of users allowed for this Room
@property (nonatomic, assign) NSInteger maxUsersDiscussion
Get the maximum number of users allowed for this Room
Declared In
SFSRoom.hname
The Room name
@property (nonatomic, retain) NSString *nameDiscussion
The Room name
Declared In
SFSRoom.hplayerList
Returns all the Users that are players in this Room (must be Game Room)
@property (nonatomic, readonly) NSArray *playerListDiscussion
Returns all the Users that are players in this Room (must be Game Room)
Declared In
SFSRoom.hproperties
The properties object can be used to store any custom value/object to the Room at runtime
@property (nonatomic, retain) NSDictionary *propertiesDiscussion
The properties object can be used to store any custom value/object to the Room at runtime
Declared In
SFSRoom.hroomManager
@cond
@property (nonatomic, assign) id<> roomManagerDiscussion
@cond
Declared In
SFSRoom.hspectatorCount
Get the number of spectators (only for Game Rooms)
@property (nonatomic, assign) NSInteger spectatorCountDiscussion
Get the number of spectators (only for Game Rooms)
Declared In
SFSRoom.hspectatorList
Returns all the Users that are spectators in this Room (must be Game Room)
@property (nonatomic, readonly) NSArray *spectatorListDiscussion
Returns all the Users that are spectators in this Room (must be Game Room)
Declared In
SFSRoom.hInstance Methods
containsUser:
Checks if a User is joined in this Room
- (BOOL)containsUser:(id<User>)userReturn Value
true if the User exists in the Room
Discussion
Checks if a User is joined in this Room
Declared In
SFSRoom.hcontainsVariable:
Check for the presence of a Room Variable
- (BOOL)containsVariable:(NSString *)nameReturn Value
true if the the Room Variable exists
Discussion
Check for the presence of a Room Variable
Declared In
SFSRoom.hgetUserById:
Get a User from its ID
- (id<User>)getUserById:(NSInteger)idReturn 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.hgetUserByName:
Get a User from its name
- (id<User>)getUserByName:(NSString *)nameReturn 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.hgetVariable:
Get a Room Variable
- (id<RoomVariable>)getVariable:(NSString *)nameParameters
- 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