Click or drag to resize

MMORoom Class

The MMORoom object represents a specialized type of Room entity on the client.
Inheritance Hierarchy
SystemObject
  Sfs2X.EntitiesSFSRoom
    Sfs2X.EntitiesMMORoom

Namespace:  Sfs2X.Entities
Assembly:  SmartFox2X (in SmartFox2X.dll) Version: 1.8.0.0 (1.8.0)
Syntax
C#
public class MMORoom : SFSRoom

The MMORoom type exposes the following members.

Properties
  NameDescription
Public propertyCapacity
Returns the maximum amount of users, including spectators, that can be contained in this Room.
(Inherited from SFSRoom.)
Public propertyDefaultAOI
Returns the default Area of Interest (AoI) of this MMORoom.
Public propertyGroupId
Returns the Room Group name.
(Inherited from SFSRoom.)
Public propertyHigherMapLimit
Returns the higher coordinates limit of the virtual environment represented by the MMORoom along the X,Y,Z axes.
Public propertyId
Indicates the id of this Room.
(Inherited from SFSRoom.)
Public propertyIsGame
Indicates whether this is a Game Room or not.
(Inherited from SFSRoom.)
Public propertyIsHidden
Indicates whether this Room is hidden or not.
(Inherited from SFSRoom.)
Public propertyIsJoined
Indicates whether the client joined this Room or not.
(Inherited from SFSRoom.)
Public propertyIsPasswordProtected
Indicates whether this Room requires a password to be joined or not.
(Inherited from SFSRoom.)
Public propertyLowerMapLimit
Returns the lower coordinates limit of the virtual environment represented by the MMORoom along the X,Y,Z axes.
Public propertyMaxSpectators
Returns the maximum number of spectators allowed in this Room (Game Rooms only).
(Inherited from SFSRoom.)
Public propertyMaxUsers
Returns the maximum number of users allowed in this Room.
(Inherited from SFSRoom.)
Public propertyName
Indicates the name of this Room.
(Inherited from SFSRoom.)
Public propertyPlayerList
Returns a list of User objects representing the players currently inside this Room (Game Rooms only).
(Inherited from SFSRoom.)
Public propertyProperties
Defines a generic utility object that can be used to store custom Room data.
(Inherited from SFSRoom.)
Public propertySpectatorCount
Returns the current number of spectators in this Room (Game Rooms only).
(Inherited from SFSRoom.)
Public propertySpectatorList
Returns a list of User objects representing the spectators currently inside this Room (Game Rooms only).
(Inherited from SFSRoom.)
Public propertyUserCount
Returns the current number of users in this Room.
(Inherited from SFSRoom.)
Public propertyUserList
Returns a list of User objects representing all the users currently inside this Room.
(Inherited from SFSRoom.)
Top
Methods
  NameDescription
Public methodContainsUser
Indicates whether the specified user is currently inside this Room or not.
(Inherited from SFSRoom.)
Public methodContainsVariable
Indicates whether this Room has the specified Room Variable set or not.
(Inherited from SFSRoom.)
Public methodGetMMOItem
Retrieves an MMOItem object from its id property.
Public methodGetMMOItems
Retrieves all MMOItem object in the MMORoom that fall within the current user's Area of Interest.
Public methodGetUserById
Retrieves a User object from its id property.
(Inherited from SFSRoom.)
Public methodGetUserByName
Retrieves a User object from its name property.
(Inherited from SFSRoom.)
Public methodGetVariable
Retrieves a Room Variable from its name.
(Inherited from SFSRoom.)
Public methodGetVariables
Retrieves all the Room Variables of this Room.
(Inherited from SFSRoom.)
Public methodToString
Returns a string that contains the Room id, name and id of the Group to which it belongs.
(Inherited from SFSRoom.)
Top
Remarks
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 PROXIMITY_LIST_UPDATE 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.

See Also