Minetest  5.4.0
RemotePlayer Class Reference

#include <remoteplayer.h>

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

Public Member Functions

 RemotePlayer (const char *name, IItemDefManager *idef)
 
virtual ~RemotePlayer ()=default
 
PlayerSAOgetPlayerSAO ()
 
void setPlayerSAO (PlayerSAO *sao)
 
const 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 (v2s32 frames[4], float frame_speed)
 
void getLocalAnimations (v2s32 *frames, float *frame_speed)
 
void setDirty (bool dirty)
 
session_t getPeerId () const
 
void setPeerId (session_t peer_id)
 
void onSuccessfulSave ()
 
- Public Member Functions inherited from Player
 Player (const char *name, IItemDefManager *idef)
 
virtual ~Player ()=0
 
 DISABLE_CLASS_COPY (Player)
 
virtual void move (f32 dtime, Environment *env, f32 pos_max_d)
 
virtual void move (f32 dtime, Environment *env, f32 pos_max_d, std::vector< CollisionInfo > *collision_info)
 
const v3fgetSpeed () const
 
void setSpeed (const v3f &speed)
 
const char * getName () const
 
u32 getFreeHudID ()
 
const PlayerControlgetPlayerControl ()
 
PlayerSettingsgetPlayerSettings ()
 
ItemStackgetWieldedItem (ItemStack *selected, ItemStack *hand) const
 
void setWieldIndex (u16 index)
 
u16 getWieldIndex () const
 
void setFov (const PlayerFovSpec &spec)
 
const PlayerFovSpecgetFov () const
 
HudElementgetHud (u32 id)
 
u32 addHud (HudElement *hud)
 
HudElementremoveHud (u32 id)
 
void clearHud ()
 

Public Attributes

u16 protocol_version = 0
 
u16 formspec_version = 1
 
- Public Attributes inherited from Player
v3f eye_offset_first
 
v3f eye_offset_third
 
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
 
v2s32 local_animations [4]
 
float local_animation_speed
 
std::string inventory_formspec
 
std::string formspec_prepend
 
PlayerControl control
 
u32 keyPressed = 0
 
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
 
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

- Static Public Member Functions inherited from Player
static void settingsChangedCallback (const std::string &name, void *data)
 
- Protected Attributes inherited from Player
char m_name [PLAYERNAME_SIZE]
 
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()

virtual RemotePlayer::~RemotePlayer ( )
virtualdefault

Member Function Documentation

◆ canSendChatMessage()

const 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 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::handleCommand_Interact(), Server::handleCommand_PlayerItem(), and ObjectRef::l_hud_get_hotbar_itemcount().

+ Here is the caller graph for this function:

◆ getHotbarSelectedImage()

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

References hud_hotbar_selected_image.

Referenced by ObjectRef::l_hud_get_hotbar_selected_image().

+ Here is the caller graph for this function:

◆ getLocalAnimations()

void RemotePlayer::getLocalAnimations ( v2s32 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 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, Metadata::setModified(), and 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:

◆ setLocalAnimations()

void RemotePlayer::setLocalAnimations ( v2s32  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::unlinkPlayerSessionAndSave().

+ Here is the caller graph for this function:

◆ setPlayerSAO()

void RemotePlayer::setPlayerSAO ( PlayerSAO sao)
inline

References m_sao.

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

+ 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 Function Documentation

◆ PlayerDatabaseFiles

friend class PlayerDatabaseFiles
friend

Member Data Documentation

◆ formspec_version

u16 RemotePlayer::formspec_version = 1

◆ 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_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: