#include <remoteplayer.h>
Public Member Functions | |
RemotePlayer (const std::string &name, IItemDefManager *idef) | |
virtual | ~RemotePlayer () |
PlayerSAO * | getPlayerSAO () |
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 SkyboxParams & | getSkyParams () const |
void | setSun (const SunParams &sun_params) |
const SunParams & | getSunParams () const |
void | setMoon (const MoonParams &moon_params) |
const MoonParams & | getMoonParams () const |
void | setStars (const StarParams &star_params) |
const StarParams & | getStarParams () const |
void | setCloudParams (const CloudParams &cloud_params) |
const CloudParams & | getCloudParams () 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 Lighting & | getLighting () 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) | |
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) |
void | setSpeed (v3f speed) |
v3f | getSpeed () const |
const std::string & | getName () const |
u32 | getFreeHudID () |
const PlayerControl & | getPlayerControl () |
ItemStack & | getWieldedItem (ItemStack *selected, ItemStack *hand) const |
void | setWieldIndex (u16 index) |
u16 | getWieldIndex () |
bool | setFov (const PlayerFovSpec &spec) |
const PlayerFovSpec & | getFov () const |
HudElement * | getHud (u32 id) |
void | hudApply (std::function< void(const std::vector< HudElement * > &)> f) |
u32 | addHud (HudElement *hud) |
HudElement * | removeHud (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 | |
PlayerSAO * | m_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 |
RemotePlayer::RemotePlayer | ( | const std::string & | name, |
IItemDefManager * | idef ) |
References BS, g_settings, SkyboxDefaults::getCloudDefaults(), Settings::getFloat(), SkyboxDefaults::getMoonDefaults(), SkyboxDefaults::getSkyDefaults(), SkyboxDefaults::getStarDefaults(), SkyboxDefaults::getSunDefaults(), Settings::getU16(), m_cloud_params, m_moon_params, m_setting_cache_loaded, m_setting_chat_message_limit_per_10sec, m_setting_chat_message_limit_trigger_kick, m_skybox_params, m_star_params, m_sun_params, Player::movement_acceleration_air, Player::movement_acceleration_default, Player::movement_acceleration_fast, Player::movement_gravity, Player::movement_liquid_fluidity, Player::movement_liquid_fluidity_smooth, Player::movement_liquid_sink, Player::movement_speed_climb, Player::movement_speed_crouch, Player::movement_speed_fast, Player::movement_speed_jump, and Player::movement_speed_walk.
|
virtual |
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().
|
inline |
References Inventory::checkModified(), Player::inventory, and m_dirty.
|
inline |
References m_cloud_params.
Referenced by ObjectRef::l_get_clouds(), and ObjectRef::l_set_clouds().
|
inline |
References m_day_night_ratio, and m_day_night_ratio_do_override.
Referenced by ObjectRef::l_get_day_night_ratio().
|
inline |
References hud_hotbar_image.
Referenced by Server::hudSetHotbarImage(), and ObjectRef::l_hud_get_hotbar_image().
|
inline |
References Player::hud_hotbar_itemcount.
Referenced by Server::hudSetHotbarItemcount().
|
inline |
References hud_hotbar_selected_image.
Referenced by Server::hudSetHotbarSelectedImage(), and ObjectRef::l_hud_get_hotbar_selected_image().
|
inline |
References m_lighting.
Referenced by ObjectRef::l_get_lighting(), and ObjectRef::l_set_lighting().
|
inline |
References Player::local_animation_speed, and Player::local_animations.
Referenced by ObjectRef::l_get_local_animation().
|
inline |
References m_moon_params.
Referenced by ObjectRef::l_get_moon(), ObjectRef::l_set_moon(), and ObjectRef::l_set_sky().
|
inline |
returns PEER_ID_INEXISTENT when PlayerSAO is not ready
References m_peer_id.
Referenced by Server::addParticleSpawner(), ServerEnvironment::addPlayer(), Server::deleteParticleSpawner(), PlayerSAO::getPeerID(), Server::handleChat(), Server::handleCommand_Init(), Server::hudAdd(), Server::hudChange(), Server::hudRemove(), Server::hudSetFlags(), Server::hudSetHotbarImage(), Server::hudSetHotbarItemcount(), Server::hudSetHotbarSelectedImage(), ModApiServer::l_ban_player(), ModApiServer::l_disconnect_player(), ModApiServer::l_get_player_information(), ModApiServer::l_get_player_ip(), ModApiServer::l_get_player_window_information(), ObjectRef::l_send_mapblock(), ObjectRef::l_set_fov(), ObjectRef::l_set_minimap_modes(), Server::notifyPlayer(), Server::overrideDayNightRatio(), Server::playSound(), ServerInventoryManager::removeDetachedInventory(), Server::reportFormspecPrependModified(), Server::reportInventoryFormspecModified(), Server::reportPrivsModified(), Server::SendInventory(), Server::setClouds(), Server::setLighting(), Server::setLocalPlayerAnimations(), Server::setMoon(), Server::setPlayerEyeOffset(), Server::setSky(), Server::setStars(), Server::setSun(), Server::showFormspec(), Server::spawnParticle(), and Server::StageTwoClientInit().
|
inline |
References m_sao.
Referenced by Server::checkInteractDistance(), Server::DeleteClient(), ServerInventoryManager::getInventory(), PlayerMetaRef::getmeta(), RemoteClient::GetNextBlocks(), Server::getPlayerSAO(), Server::handleCommand_Damage(), Server::handleCommand_Interact(), Server::handleCommand_InventoryAction(), Server::handleCommand_InventoryFields(), Server::handleCommand_NodeMetaFields(), Server::handleCommand_PlayerItem(), Server::handleCommand_PlayerPos(), Server::hudSetFlags(), ModApiEnv::l_get_player_by_name(), Server::playSound(), PlayerSAO::punch(), PlayerSAO::removingFromEnvironment(), Server::reportPrivsModified(), PlayerDatabaseLevelDB::savePlayer(), PlayerDatabaseSQLite3::savePlayer(), Server::SendAddParticleSpawner(), Server::sendNodeChangePkt(), Server::SendSpawnParticle(), PlayerSAO::unlinkPlayerSessionAndSave(), and Server::UpdateCrafting().
|
inline |
References m_skybox_params.
Referenced by RemoteClient::GetNextBlocks(), ObjectRef::l_get_sky(), ObjectRef::l_get_sky_color(), and ObjectRef::l_set_sky().
|
inline |
References m_star_params.
Referenced by ObjectRef::l_get_stars(), ObjectRef::l_set_sky(), and ObjectRef::l_set_stars().
|
inline |
References m_sun_params.
Referenced by ObjectRef::l_get_sun(), ObjectRef::l_set_sky(), and ObjectRef::l_set_sun().
void RemotePlayer::onSuccessfulSave | ( | ) |
References PlayerSAO::getMeta(), m_sao, setModified(), and SimpleMetadata::setModified().
Referenced by PlayerDatabaseFiles::savePlayer(), PlayerDatabaseLevelDB::savePlayer(), and PlayerDatabaseSQLite3::savePlayer().
|
inline |
References m_day_night_ratio, and m_day_night_ratio_do_override.
Referenced by Server::overrideDayNightRatio().
|
inline |
References m_cloud_params.
Referenced by Server::setClouds().
|
inline |
References m_dirty.
Referenced by PlayerSAO::setBasePosition(), PlayerSAO::setBreath(), PlayerSAO::setFov(), PlayerSAO::setLookPitch(), PlayerSAO::setPlayerYaw(), and PlayerSAO::setWantedRange().
|
inline |
References hud_hotbar_image.
Referenced by Server::hudSetHotbarImage().
|
inline |
References Player::hud_hotbar_itemcount.
Referenced by Server::hudSetHotbarItemcount().
|
inline |
References hud_hotbar_selected_image.
Referenced by Server::hudSetHotbarSelectedImage().
|
inline |
References m_lighting.
Referenced by Server::setLighting().
|
inline |
References Player::local_animation_speed, and Player::local_animations.
Referenced by Server::setLocalPlayerAnimations().
|
inline |
References m_dirty.
Referenced by ServerEnvironment::loadPlayer(), onSuccessfulSave(), Server::SendInventory(), and ServerInventoryManager::setInventoryModified().
|
inline |
References m_moon_params.
Referenced by Server::setMoon().
|
inline |
References m_peer_id.
Referenced by PlayerSAO::addedToEnvironment(), and PlayerSAO::disconnected().
|
inline |
References m_sao.
Referenced by PlayerSAO::addedToEnvironment(), and ServerEnvironment::migratePlayersDatabase().
|
inline |
References m_skybox_params.
Referenced by Server::setSky().
|
inline |
References m_star_params.
Referenced by Server::setStars().
|
inline |
References m_sun_params.
Referenced by Server::setSun().
|
friend |
u16 RemotePlayer::formspec_version = 0 |
Referenced by Server::handleCommand_ClientReady(), and ModApiServer::l_get_player_information().
|
private |
Referenced by getHotbarImage(), and setHotbarImage().
|
private |
Referenced by getHotbarSelectedImage(), and setHotbarSelectedImage().
|
private |
Referenced by canSendChatMessage().
|
private |
Referenced by RemotePlayer(), getCloudParams(), and setCloudParams().
|
private |
Referenced by getDayNightRatio(), and overrideDayNightRatio().
|
private |
Referenced by getDayNightRatio(), and overrideDayNightRatio().
|
private |
Referenced by checkModified(), setDirty(), and setModified().
|
private |
Referenced by canSendChatMessage().
|
private |
Referenced by getLighting(), and setLighting().
|
private |
Referenced by canSendChatMessage().
|
private |
Referenced by RemotePlayer(), getMoonParams(), and setMoon().
|
private |
Referenced by getPeerId(), and setPeerId().
|
private |
Referenced by ~RemotePlayer(), getPlayerSAO(), onSuccessfulSave(), and setPlayerSAO().
|
staticprivate |
Referenced by RemotePlayer().
|
staticprivate |
Referenced by RemotePlayer(), and canSendChatMessage().
|
staticprivate |
Referenced by RemotePlayer(), and canSendChatMessage().
|
private |
Referenced by RemotePlayer(), getSkyParams(), and setSky().
|
private |
Referenced by RemotePlayer(), getStarParams(), and setStars().
|
private |
Referenced by RemotePlayer(), getSunParams(), and setSun().
u16 RemotePlayer::protocol_version = 0 |