SFS2X Objective-C API  1.7.13
iOS / macOS / tvOS
MMORoom.h
1 //
2 // MMORoom.h
3 // SFS2X
4 //
5 // Created by Lapo on 29/11/13.
6 // Copyright (c) 2013 A51 Integrated | http://a51integrated.com. All rights reserved.
7 //
8 
9 #import "SFSRoom.h"
10 #import "Vec3D.h"
11 #import "IMMOItem.h"
12 
13 /** The MMORoomobject represents a specialized type of Room entity on the client.
14 
15  The MMORoom is ideal for huge virtual worlds and MMO games because it works with proximity lists instead of "regular" users lists.
16 
17  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.
18 
19  The size of the AoI is set at Room creation time and it is the same for all users who joined it.
20  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.
21 
22  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.
23 
24  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.
25 
26  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.
27 
28  @see CreateRoomRequest
29  @see MMORoomSettings
30  @see SetUserPositionRequest
31  @see MMOItem
32  @see [ISFSEvents onProximityListUpdate]
33 
34  */
35 @interface MMORoom : SFSRoom
36 
37 /**
38  The default Area of Interest (AoI) of this MMORoom.
39  @see Vec3D
40  */
41 @property (strong, nonatomic) Vec3D* defaultAOI;
42 
43 /**
44  The lower coordinates value for the MMORoom.
45  @see Vec3D
46  */
47 @property (strong, nonatomic) Vec3D* lowerMapLimit;
48 
49 /**
50  The highest coordinates value for the MMORoom.
51  @see Vec3D
52  */
53 @property (strong, nonatomic) Vec3D* higherMapLimit;
54 
55 /** Gets an MMOItem by its unique id
56  @param itemId the id
57  @return the MMOItem or nil if no item was found with the provided id
58  @see MMOItem
59  */
60 - (id<IMMOItem>) getMMOItem:(NSInteger)itemId;
61 
62 /** Get all MMOItems managed by this MMORoom
63  @return all MMOItems
64  @see MMOItem
65  */
66 - (NSArray*) getMMOItems;
67 
68 
69 - (void) addMMOItem:(id<IMMOItem>)item;
70 - (void) removeMMOItem:(NSInteger) itemId;
71 
72 @end
MMORoom::defaultAOI
Vec3D * defaultAOI
Definition: MMORoom.h:41
MMORoom::lowerMapLimit
Vec3D * lowerMapLimit
Definition: MMORoom.h:47
SFSRoom
Definition: SFSRoom.h:35
-[MMORoom getMMOItems]
NSArray * getMMOItems()
Definition: MMORoom.m:40
MMORoom
Definition: MMORoom.h:35
Vec3D
Definition: Vec3D.h:26
SFSRoom::id
NSInteger id
Definition: SFSRoom.h:61
MMORoom::higherMapLimit
Vec3D * higherMapLimit
Definition: MMORoom.h:53