|
| std::optional< Vec3D > | getDefaultAOI () const |
| | The default Area of Interest (AoI) of this Room, the range around a user within which server and user events are received.
|
| std::optional< Vec3D > | getLowerMapLimit () const |
| | The lower coordinates limit of the virtual environment along the X, Y and Z axes.
|
| std::optional< Vec3D > | getHigherMapLimit () const |
| | The higher coordinates limit of the virtual environment along the X, Y and Z axes.
|
| std::shared_ptr< MMOItem > | getMMOItem (int32_t id) const |
| | Retrieves an MMOItem from its id.
|
|
std::vector< std::shared_ptr< MMOItem > > | getMMOItems () const |
| | Retrieves all the MMOItems in this Room that fall within the current user's Area of Interest; an empty list when none does.
|
| std::string | toString () const override |
| int32_t | getId () const override |
| std::string | getName () const override |
| | Returns the unique name of this Room.
|
| RoomType | getType () const override |
| std::optional< std::string > | getGroupId () const override |
| | Returns the name of the Group this Room belongs to.
|
| int32_t | getUserCount () const override |
| | Returns the current number of users in this Room.
|
| int32_t | getSpectatorCount () const override |
| int32_t | getMaxUsers () const override |
| | Returns the maximum number of users allowed in this Room.
|
| int32_t | getMaxSpectators () const override |
| | Returns the maximum number of spectators allowed in this Room.
|
| std::vector< std::shared_ptr< User > > | getPlayerList () const override |
| std::vector< std::shared_ptr< User > > | getSpectatorList () const override |
| bool | isGame () const override |
| | Tells if this is a Game Room or not.
|
| bool | isHidden () const override |
| | Tells if this Room is hidden or not.
|
| bool | isJoined () const override |
| | Tells if the client joined this Room or not.
|
| bool | isPasswordProtected () const override |
| | Tells if this Room needs a password to be joined or not.
|
| bool | containsUser (std::shared_ptr< entities::User > user) const override |
| | Tells if the given user is currently inside this Room or not.
|
| std::shared_ptr< User > | getUserById (int32_t id) const override |
| | Retrieves a user inside this Room from his id.
|
| std::shared_ptr< User > | getUserByName (const std::string &name) const override |
| | Retrieves a user inside this Room from his name.
|
| std::vector< std::shared_ptr< User > > | getUserList () const override |
| core::RoomManager * | roomManager () const override |
| std::shared_ptr< RoomVariable > | getVariable (const std::string &name) const override |
| | Retrieves a Room Variable from its name.
|
| std::vector< std::shared_ptr< RoomVariable > > | getVariables () const override |
| bool | containsVariable (const std::string &name) const override |
| | Tells if this Room has the given Room Variable set or not.
|
| std::string | toString () const override |
A specialized Room working with proximity lists instead of "regular" user lists.
The MMORoom is meant for huge virtual worlds and MMO games: thousands of users can interact based on their Area of Interest (AoI), the range around a user within which server and user events are received. The AoI is set when the Room is created and is the same for every user who joined it. As a user moves around the virtual environment he updates his position with a requests::SetUserPositionRequest, and keeps receiving event::SFSEvent::PROXIMITY_LIST_UPDATE events about the other users entering and leaving his AoI.
MMORooms can also host any number of MMOItems, non-player objects handled with the same rules of visibility.
NOTE: developers never instantiate an MMORoom manually; this is done by the API internally when the server describes the Room. A Room reaches the consumer as a Room, so reaching the MMO properties means narrowing it first — see from().
if (auto* mmoRoom = entities::MMORoom::from(room.get()))
{
auto aoi = mmoRoom->getDefaultAOI();
}
- See also
- requests::MMOSettings
-
MMOItem
-
requests::SetUserPositionRequest