Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
RemotePlayer Class Reference

#include <remoteplayer.h>

+ Inheritance diagram for RemotePlayer:
+ Collaboration diagram for RemotePlayer:

Public Member Functions

 RemotePlayer (const std::string &name, IItemDefManager *idef)
 
virtual ~RemotePlayer ()
 
PlayerSAOgetPlayerSAO ()
 
void setPlayerSAO (PlayerSAO *sao)
 
RemotePlayerChatResult canSendChatMessage ()
 
void setHotbarItemcount (s32 hotbar_itemcount)
 
s32 getHotbarItemcount () const
 
void overrideDayNightRatio (bool do_override, float ratio)
 
void getDayNightRatio (bool *do_override, float *ratio)
 
void setHotbarImage (const std::string &name)
 
const std::string & getHotbarImage () const
 
void setHotbarSelectedImage (const std::string &name)
 
const std::string & getHotbarSelectedImage () const
 
void setSky (const SkyboxParams &skybox_params)
 
const SkyboxParamsgetSkyParams () const
 
void setSun (const SunParams &sun_params)
 
const SunParamsgetSunParams () const
 
void setMoon (const MoonParams &moon_params)
 
const MoonParamsgetMoonParams () const
 
void setStars (const StarParams &star_params)
 
const StarParamsgetStarParams () const
 
void setCloudParams (const CloudParams &cloud_params)
 
const CloudParamsgetCloudParams () const
 
bool checkModified () const
 
void setModified (const bool x)
 
void setLocalAnimations (v2f frames[4], float frame_speed)
 
void getLocalAnimations (v2f *frames, float *frame_speed)
 
void setLighting (const Lighting &lighting)
 
const LightinggetLighting () const
 
void setDirty (bool dirty)
 
session_t getPeerId () const
 returns PEER_ID_INEXISTENT when PlayerSAO is not ready
 
void setPeerId (session_t peer_id)
 
void onSuccessfulSave ()
 
- Public Member Functions inherited from Player
 Player (const std::string &name, IItemDefManager *idef)
 
virtual ~Player ()=0
 
 DISABLE_CLASS_COPY (Player)
 
void setSpeed (v3f speed)
 
v3f getSpeed () const
 
const std::string & getName () const
 
u32 getFreeHudID ()
 
const PlayerControlgetPlayerControl ()
 
ItemStackgetWieldedItem (ItemStack *selected, ItemStack *hand) const
 
void setWieldIndex (u16 index)
 
u16 getWieldIndex ()
 
bool setFov (const PlayerFovSpec &spec)
 
const PlayerFovSpecgetFov () const
 
HudElementgetHud (u32 id)
 
void hudApply (std::function< void(const std::vector< HudElement * > &)> f)
 
u32 addHud (HudElement *hud)
 
HudElementremoveHud (u32 id)
 
void clearHud ()
 
u16 getMaxHotbarItemcount ()
 

Public Attributes

u16 protocol_version = 0
 
u16 formspec_version = 0
 
- Public Attributes inherited from Player
v3f eye_offset_first
 
v3f eye_offset_third
 
v3f eye_offset_third_front
 
Inventory inventory
 
f32 movement_acceleration_default
 
f32 movement_acceleration_air
 
f32 movement_acceleration_fast
 
f32 movement_speed_walk
 
f32 movement_speed_crouch
 
f32 movement_speed_fast
 
f32 movement_speed_climb
 
f32 movement_speed_jump
 
f32 movement_liquid_fluidity
 
f32 movement_liquid_fluidity_smooth
 
f32 movement_liquid_sink
 
f32 movement_gravity
 
v2f local_animations [4]
 
float local_animation_speed
 
std::string inventory_formspec
 
std::string formspec_prepend
 
PlayerControl control
 
PlayerPhysicsOverride physics_override
 
u32 hud_flags
 
s32 hud_hotbar_itemcount
 

Private Attributes

PlayerSAOm_sao = nullptr
 
bool m_dirty = false
 
u32 m_last_chat_message_sent = std::time(0)
 
float m_chat_message_allowance = 5.0f
 
u16 m_message_rate_overhead = 0
 
bool m_day_night_ratio_do_override = false
 
float m_day_night_ratio
 
std::string hud_hotbar_image = ""
 
std::string hud_hotbar_selected_image = ""
 
CloudParams m_cloud_params
 
SkyboxParams m_skybox_params
 
SunParams m_sun_params
 
MoonParams m_moon_params
 
StarParams m_star_params
 
Lighting m_lighting
 
session_t m_peer_id = PEER_ID_INEXISTENT
 

Static Private Attributes

static bool m_setting_cache_loaded = false
 
static float m_setting_chat_message_limit_per_10sec = 0.0f
 
static u16 m_setting_chat_message_limit_trigger_kick = 0
 

Friends

class PlayerDatabaseFiles
 

Additional Inherited Members

- Protected Attributes inherited from Player
std::string m_name
 
v3f m_speed
 
u16 m_wield_index = 0
 
PlayerFovSpec m_fov_override_spec = { 0.0f, false, 0.0f }
 
std::vector< HudElement * > hud
 

Constructor & Destructor Documentation

◆ RemotePlayer()

◆ ~RemotePlayer()

RemotePlayer::~RemotePlayer ( )
virtual

References m_sao, and PlayerSAO::setPlayer().

+ Here is the call graph for this function:

Member Function Documentation

◆ canSendChatMessage()

RemotePlayerChatResult RemotePlayer::canSendChatMessage ( )

References infostream, m_chat_message_allowance, m_last_chat_message_sent, m_message_rate_overhead, Player::m_name, m_setting_chat_message_limit_per_10sec, m_setting_chat_message_limit_trigger_kick, RPLAYER_CHATRESULT_FLOODING, RPLAYER_CHATRESULT_KICK, and RPLAYER_CHATRESULT_OK.

Referenced by Server::handleChat().

+ Here is the caller graph for this function:

◆ checkModified()

bool RemotePlayer::checkModified ( ) const
inline

References Inventory::checkModified(), Player::inventory, and m_dirty.

+ Here is the call graph for this function:

◆ getCloudParams()

const CloudParams & RemotePlayer::getCloudParams ( ) const
inline

References m_cloud_params.

Referenced by ObjectRef::l_get_clouds(), and ObjectRef::l_set_clouds().

+ Here is the caller graph for this function:

◆ getDayNightRatio()

void RemotePlayer::getDayNightRatio ( bool * do_override,
float * ratio )
inline

References m_day_night_ratio, and m_day_night_ratio_do_override.

Referenced by ObjectRef::l_get_day_night_ratio().

+ Here is the caller graph for this function:

◆ getHotbarImage()

const std::string & RemotePlayer::getHotbarImage ( ) const
inline

References hud_hotbar_image.

Referenced by Server::hudSetHotbarImage(), and ObjectRef::l_hud_get_hotbar_image().

+ Here is the caller graph for this function:

◆ getHotbarItemcount()

s32 RemotePlayer::getHotbarItemcount ( ) const
inline

References Player::hud_hotbar_itemcount.

Referenced by Server::hudSetHotbarItemcount().

+ Here is the caller graph for this function:

◆ getHotbarSelectedImage()

const std::string & RemotePlayer::getHotbarSelectedImage ( ) const
inline

References hud_hotbar_selected_image.

Referenced by Server::hudSetHotbarSelectedImage(), and ObjectRef::l_hud_get_hotbar_selected_image().

+ Here is the caller graph for this function:

◆ getLighting()

const Lighting & RemotePlayer::getLighting ( ) const
inline

References m_lighting.

Referenced by ObjectRef::l_get_lighting(), and ObjectRef::l_set_lighting().

+ Here is the caller graph for this function:

◆ getLocalAnimations()

void RemotePlayer::getLocalAnimations ( v2f * frames,
float * frame_speed )
inline

References Player::local_animation_speed, and Player::local_animations.

Referenced by ObjectRef::l_get_local_animation().

+ Here is the caller graph for this function:

◆ getMoonParams()

const MoonParams & RemotePlayer::getMoonParams ( ) const
inline

References m_moon_params.

Referenced by ObjectRef::l_get_moon(), ObjectRef::l_set_moon(), and ObjectRef::l_set_sky().

+ Here is the caller graph for this function:

◆ getPeerId()

◆ getPlayerSAO()

◆ getSkyParams()

const SkyboxParams & RemotePlayer::getSkyParams ( ) const
inline

References m_skybox_params.

Referenced by RemoteClient::GetNextBlocks(), ObjectRef::l_get_sky(), ObjectRef::l_get_sky_color(), and ObjectRef::l_set_sky().

+ Here is the caller graph for this function:

◆ getStarParams()

const StarParams & RemotePlayer::getStarParams ( ) const
inline

References m_star_params.

Referenced by ObjectRef::l_get_stars(), ObjectRef::l_set_sky(), and ObjectRef::l_set_stars().

+ Here is the caller graph for this function:

◆ getSunParams()

const SunParams & RemotePlayer::getSunParams ( ) const
inline

References m_sun_params.

Referenced by ObjectRef::l_get_sun(), ObjectRef::l_set_sky(), and ObjectRef::l_set_sun().

+ Here is the caller graph for this function:

◆ onSuccessfulSave()

void RemotePlayer::onSuccessfulSave ( )

References PlayerSAO::getMeta(), m_sao, setModified(), and SimpleMetadata::setModified().

Referenced by PlayerDatabaseFiles::savePlayer(), PlayerDatabaseLevelDB::savePlayer(), and PlayerDatabaseSQLite3::savePlayer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ overrideDayNightRatio()

void RemotePlayer::overrideDayNightRatio ( bool do_override,
float ratio )
inline

References m_day_night_ratio, and m_day_night_ratio_do_override.

Referenced by Server::overrideDayNightRatio().

+ Here is the caller graph for this function:

◆ setCloudParams()

void RemotePlayer::setCloudParams ( const CloudParams & cloud_params)
inline

References m_cloud_params.

Referenced by Server::setClouds().

+ Here is the caller graph for this function:

◆ setDirty()

void RemotePlayer::setDirty ( bool dirty)
inline

References m_dirty.

Referenced by PlayerSAO::setBasePosition(), PlayerSAO::setBreath(), PlayerSAO::setFov(), PlayerSAO::setLookPitch(), PlayerSAO::setPlayerYaw(), and PlayerSAO::setWantedRange().

+ Here is the caller graph for this function:

◆ setHotbarImage()

void RemotePlayer::setHotbarImage ( const std::string & name)
inline

References hud_hotbar_image.

Referenced by Server::hudSetHotbarImage().

+ Here is the caller graph for this function:

◆ setHotbarItemcount()

void RemotePlayer::setHotbarItemcount ( s32 hotbar_itemcount)
inline

References Player::hud_hotbar_itemcount.

Referenced by Server::hudSetHotbarItemcount().

+ Here is the caller graph for this function:

◆ setHotbarSelectedImage()

void RemotePlayer::setHotbarSelectedImage ( const std::string & name)
inline

References hud_hotbar_selected_image.

Referenced by Server::hudSetHotbarSelectedImage().

+ Here is the caller graph for this function:

◆ setLighting()

void RemotePlayer::setLighting ( const Lighting & lighting)
inline

References m_lighting.

Referenced by Server::setLighting().

+ Here is the caller graph for this function:

◆ setLocalAnimations()

void RemotePlayer::setLocalAnimations ( v2f frames[4],
float frame_speed )
inline

References Player::local_animation_speed, and Player::local_animations.

Referenced by Server::setLocalPlayerAnimations().

+ Here is the caller graph for this function:

◆ setModified()

void RemotePlayer::setModified ( const bool x)
inline

References m_dirty.

Referenced by ServerEnvironment::loadPlayer(), onSuccessfulSave(), Server::SendInventory(), and ServerInventoryManager::setInventoryModified().

+ Here is the caller graph for this function:

◆ setMoon()

void RemotePlayer::setMoon ( const MoonParams & moon_params)
inline

References m_moon_params.

Referenced by Server::setMoon().

+ Here is the caller graph for this function:

◆ setPeerId()

void RemotePlayer::setPeerId ( session_t peer_id)
inline

References m_peer_id.

Referenced by PlayerSAO::addedToEnvironment(), and PlayerSAO::disconnected().

+ Here is the caller graph for this function:

◆ setPlayerSAO()

void RemotePlayer::setPlayerSAO ( PlayerSAO * sao)
inline

References m_sao.

Referenced by PlayerSAO::addedToEnvironment(), and ServerEnvironment::migratePlayersDatabase().

+ Here is the caller graph for this function:

◆ setSky()

void RemotePlayer::setSky ( const SkyboxParams & skybox_params)
inline

References m_skybox_params.

Referenced by Server::setSky().

+ Here is the caller graph for this function:

◆ setStars()

void RemotePlayer::setStars ( const StarParams & star_params)
inline

References m_star_params.

Referenced by Server::setStars().

+ Here is the caller graph for this function:

◆ setSun()

void RemotePlayer::setSun ( const SunParams & sun_params)
inline

References m_sun_params.

Referenced by Server::setSun().

+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ PlayerDatabaseFiles

friend class PlayerDatabaseFiles
friend

Member Data Documentation

◆ formspec_version

u16 RemotePlayer::formspec_version = 0

◆ hud_hotbar_image

std::string RemotePlayer::hud_hotbar_image = ""
private

Referenced by getHotbarImage(), and setHotbarImage().

◆ hud_hotbar_selected_image

std::string RemotePlayer::hud_hotbar_selected_image = ""
private

◆ m_chat_message_allowance

float RemotePlayer::m_chat_message_allowance = 5.0f
private

Referenced by canSendChatMessage().

◆ m_cloud_params

CloudParams RemotePlayer::m_cloud_params
private

◆ m_day_night_ratio

float RemotePlayer::m_day_night_ratio
private

◆ m_day_night_ratio_do_override

bool RemotePlayer::m_day_night_ratio_do_override = false
private

◆ m_dirty

bool RemotePlayer::m_dirty = false
private

◆ m_last_chat_message_sent

u32 RemotePlayer::m_last_chat_message_sent = std::time(0)
private

Referenced by canSendChatMessage().

◆ m_lighting

Lighting RemotePlayer::m_lighting
private

Referenced by getLighting(), and setLighting().

◆ m_message_rate_overhead

u16 RemotePlayer::m_message_rate_overhead = 0
private

Referenced by canSendChatMessage().

◆ m_moon_params

MoonParams RemotePlayer::m_moon_params
private

◆ m_peer_id

session_t RemotePlayer::m_peer_id = PEER_ID_INEXISTENT
private

Referenced by getPeerId(), and setPeerId().

◆ m_sao

PlayerSAO* RemotePlayer::m_sao = nullptr
private

◆ m_setting_cache_loaded

bool RemotePlayer::m_setting_cache_loaded = false
staticprivate

Referenced by RemotePlayer().

◆ m_setting_chat_message_limit_per_10sec

float RemotePlayer::m_setting_chat_message_limit_per_10sec = 0.0f
staticprivate

Referenced by RemotePlayer(), and canSendChatMessage().

◆ m_setting_chat_message_limit_trigger_kick

u16 RemotePlayer::m_setting_chat_message_limit_trigger_kick = 0
staticprivate

Referenced by RemotePlayer(), and canSendChatMessage().

◆ m_skybox_params

SkyboxParams RemotePlayer::m_skybox_params
private

Referenced by RemotePlayer(), getSkyParams(), and setSky().

◆ m_star_params

StarParams RemotePlayer::m_star_params
private

◆ m_sun_params

SunParams RemotePlayer::m_sun_params
private

Referenced by RemotePlayer(), getSunParams(), and setSun().

◆ protocol_version


The documentation for this class was generated from the following files: