SmartFoxServer 3 C++ Client API 3.1.0-beta
Client API for SmartFoxServer 3
Loading...
Searching...
No Matches
sfs3::event::ProximityListUpdate Struct Reference

Dispatched when the current user's proximity list changes in an MMORoom, after he or another user moved: it reports who and what entered or left his Area of Interest. More...

#include <SFSEvent.h>

Public Attributes

std::shared_ptr< entities::Roomroom
 The MMORoom the update refers to.
std::vector< std::shared_ptr< entities::User > > addedUsers
 The users who entered the current user's Area of Interest.
std::vector< std::shared_ptr< entities::User > > removedUsers
 The users who left the current user's Area of Interest.
std::vector< std::shared_ptr< entities::MMOItem > > addedItems
 The items that entered the current user's Area of Interest.
std::vector< std::shared_ptr< entities::MMOItem > > removedItems
 The items that left the current user's Area of Interest.

Detailed Description

Dispatched when the current user's proximity list changes in an MMORoom, after he or another user moved: it reports who and what entered or left his Area of Interest.

It is usually caused by a requests::SetUserPositionRequest.

The server sends this at the rate set by requests::MMOSettings::proximityListUpdateMillis, not on every change of position, and it lists only the differences — the users and items already in the Area of Interest are not repeated. The removed lists carry entities that are no longer in proximity: they are already out of the Room, so this is the last chance to read them.

The entry point where an added user or item appeared is available through entities::User::getAOIEntryPoint and entities::MMOItem::getAOIEntryPoint, if the Room was created with requests::MMOSettings::sendAOIEntryPoint left on.

See also
requests::MMOSettings
requests::SetUserPositionRequest
entities::MMORoom

The documentation for this struct was generated from the following file: