SFS2X Objective-C API
1.7.13
iOS / macOS / tvOS
|
#import <MMORoom.h>
Inherits SFSRoom.
Instance Methods | |
(id< IMMOItem >) | - getMMOItem: |
(NSArray *) | - getMMOItems |
(void) | - addMMOItem: |
(void) | - removeMMOItem: |
![]() | |
(id) | - initWithId:name:groupId: |
(NSArray *) | - getVariables |
(id< RoomVariable >) | - getVariable: |
(id< User >) | - getUserByName: |
(id< User >) | - getUserById: |
(BOOL) | - containsVariable: |
(BOOL) | - containsUser: |
(void) | - merge: |
Properties | |
Vec3D * | defaultAOI |
Vec3D * | lowerMapLimit |
Vec3D * | higherMapLimit |
![]() | |
NSInteger | id |
NSString * | name |
NSString * | groupId |
BOOL | isGame |
BOOL | isHidden |
BOOL | isJoined |
BOOL | isPasswordProtected |
BOOL | isManaged |
NSInteger | maxUsers |
NSInteger | maxSpectators |
NSInteger | userCount |
NSInteger | capacity |
NSInteger | spectatorCount |
NSDictionary * | properties |
id< IRoomManager > | roomManager |
NSArray * | userList |
NSArray * | playerList |
NSArray * | spectatorList |
Additional Inherited Members | |
![]() | |
(id< Room >) | + fromSFSArray: |
![]() | |
NSInteger | _id |
NSString * | _name |
NSString * | _groupId |
BOOL | _isGame |
BOOL | _isHidden |
BOOL | _isJoined |
BOOL | _isPasswordProtected |
BOOL | _isManaged |
NSMutableDictionary * | _variables |
NSDictionary * | _properties |
id< IUserManager > | _userManager |
NSInteger | _maxUsers |
NSInteger | _maxSpectators |
NSInteger | _userCount |
NSInteger | _spectatorCount |
__weak id< IRoomManager > | _roomManager |
The MMORoomobject represents a specialized type of Room entity on the client.
The MMORoom is ideal for huge virtual worlds and MMO games because it works with proximity lists instead of "regular" users lists.
This allows thousands of users to interact with each other based on their Area of Interest (AoI). The AoI represents a range around the user that is affected by server and user events, outside which no other events are received.
The size of the AoI is set at Room creation time and it is the same for all users who joined it. Supposing that the MMORoom hosts a 3D virtual world, setting an AoI of (x=100, y=100, z=40) for the Room tells the server to transmit updates and broadcast events to and from those users that fall within the AoI range around the current user; this means the area within +/- 100 units on the X axis, +/- 100 units on the Y axis and +/- 40 units on the Z axis.
As the user moves around in the virtual environment, he can update his position in the corresponding MMORoom and thus continuously receive events about other users (and items - see below) entering and leaving his AoI.
The player will be able to update his position via the SetUserPositionRequest request and receive updates on his current proximity list by means of the [ISFSEvents onProximityListUpdate] event.
Finally, MMORooms can also host any number of "MMOItems" which represent dynamic non-player objects that users can interact with. They are handled by the MMORoom using the same rules of visibility described before.
- (id< IMMOItem >) getMMOItem: | (NSInteger) | itemId |
- (NSArray *) getMMOItems |
|
readwritenonatomicstrong |
|
readwritenonatomicstrong |