SmartFoxServer 3 C++ Client API 3.1.0-beta
Client API for SmartFoxServer 3
Loading...
Searching...
No Matches
sfs3::requests::SetUserPositionRequest Class Reference

Updates the current user's position inside an MMORoom. More...

#include <SetUserPositionRequest.h>

Inheritance diagram for sfs3::requests::SetUserPositionRequest:
[legend]

Public Member Functions

 SetUserPositionRequest (entities::Vec3D position, std::shared_ptr< entities::Room > room=nullptr)

Detailed Description

Updates the current user's position inside an MMORoom.

MMORooms represent virtual environments and can host any number of users. Based on their position, the system lets users within a certain range of each other (their Area of Interest) interact. This request updates the position of the current user, which in turn triggers a PROXIMITY_LIST_UPDATE event for every user whose AoI he entered or left.

NOTE: the coordinates must use the same numeric mode (integer or float) as the Room's area of interest, which is what fixes the Room's coordinates system when it is created. A mismatch is refused by the server.

sfs.send(requests::SetUserPositionRequest(entities::Vec3D::ofInt(120, 50)));
See also
MMOSettings
event::SFSEvent::PROXIMITY_LIST_UPDATE

Constructor & Destructor Documentation

◆ SetUserPositionRequest()

sfs3::requests::SetUserPositionRequest::SetUserPositionRequest ( entities::Vec3D position,
std::shared_ptr< entities::Room > room = nullptr )
inline
Parameters
positionthe user's new position
roomthe MMORoom where the position should be set; if nullptr, the last Room joined by the current user is used

The documentation for this class was generated from the following files:
  • requests/mmo/SetUserPositionRequest.h
  • requests/mmo/SetUserPositionRequest.cpp