#include <player_sao.h>
Public Member Functions | |
PlayerSAO (ServerEnvironment *env_, RemotePlayer *player_, session_t peer_id_, bool is_singleplayer) | |
ActiveObjectType | getType () const override |
ActiveObjectType | getSendType () const override |
std::string | getDescription () override |
void | addedToEnvironment (u32 dtime_s) override |
void | removingFromEnvironment () override |
bool | isStaticAllowed () const override |
bool | shouldUnload () const override |
std::string | getClientInitializationData (u16 protocol_version) override |
void | getStaticData (std::string *result) const override |
void | step (float dtime, bool send_recommended) override |
void | setBasePosition (v3f position) |
void | setPos (const v3f &pos) override |
void | addPos (const v3f &added_pos) override |
void | moveTo (v3f pos, bool continuous) override |
void | setPlayerYaw (const float yaw) |
void | setPlayerYawAndSend (const float yaw) |
void | setLookPitch (const float pitch) |
void | setLookPitchAndSend (const float pitch) |
f32 | getLookPitch () const |
f32 | getRadLookPitch () const |
f32 | getRadLookPitchDep () const |
void | setFov (const float pitch) |
f32 | getFov () const |
void | setWantedRange (const s16 range) |
s16 | getWantedRange () const |
void | setCameraInverted (bool camera_inverted) |
bool | getCameraInverted () const |
u32 | punch (v3f dir, const ToolCapabilities *toolcap, ServerActiveObject *puncher, float time_from_last_punch, u16 initial_wear=0) override |
void | rightClick (ServerActiveObject *clicker) override |
void | setHP (s32 hp, const PlayerHPChangeReason &reason) override |
void | setHP (s32 hp, const PlayerHPChangeReason &reason, bool from_client) |
void | setHPRaw (u16 hp) |
u16 | getBreath () const |
void | setBreath (const u16 breath, bool send=true) |
void | respawn () |
Inventory * | getInventory () const override |
InventoryLocation | getInventoryLocation () const override |
void | setInventoryModified () override |
std::string | getWieldList () const override |
u16 | getWieldIndex () const override |
ItemStack | getWieldedItem (ItemStack *selected, ItemStack *hand=nullptr) const override |
bool | setWieldedItem (const ItemStack &item) override |
void | disconnected () |
void | setPlayer (RemotePlayer *player) |
RemotePlayer * | getPlayer () |
session_t | getPeerID () const |
v3f | getLastGoodPosition () const |
float | resetTimeFromLastPunch () |
void | noCheatDigStart (const v3s16 &p) |
v3s16 | getNoCheatDigPos () |
float | getNoCheatDigTime () |
void | noCheatDigEnd () |
LagPool & | getDigPool () |
void | setMaxSpeedOverride (const v3f &vel) |
bool | checkMovementCheat () |
void | updatePrivileges (const std::set< std::string > &privs, bool is_singleplayer) |
bool | getCollisionBox (aabb3f *toset) const override |
bool | getSelectionBox (aabb3f *toset) const override |
bool | collideWithObjects () const override |
void | finalize (RemotePlayer *player, const std::set< std::string > &privs) |
v3f | getEyePosition () const |
v3f | getEyeOffset () const |
float | getZoomFOV () const |
SimpleMetadata & | getMeta () |
Public Member Functions inherited from UnitSAO | |
UnitSAO (ServerEnvironment *env, v3f pos) | |
virtual | ~UnitSAO ()=default |
u16 | getHP () const override |
bool | isDead () const |
void | setRotation (v3f rotation) |
const v3f & | getRotation () const |
const v3f | getTotalRotation () const |
v3f | getRadRotation () |
f32 | getRadYawDep () const |
bool | isImmortal () const |
void | setArmorGroups (const ItemGroupList &armor_groups) override |
const ItemGroupList & | getArmorGroups () const override |
void | setAnimation (v2f frame_range, float frame_speed, float frame_blend, bool frame_loop) override |
void | getAnimation (v2f *frame_range, float *frame_speed, float *frame_blend, bool *frame_loop) override |
void | setAnimationSpeed (float frame_speed) override |
void | setBoneOverride (const std::string &bone, const BoneOverride &props) override |
BoneOverride | getBoneOverride (const std::string &bone) override |
const std::unordered_map< std::string, BoneOverride > & | getBoneOverrides () const override |
ServerActiveObject * | getParent () const override |
bool | isAttached () const |
void | setAttachment (object_t parent_id, const std::string &bone, v3f position, v3f rotation, bool force_visible) override |
void | getAttachment (object_t *parent_id, std::string *bone, v3f *position, v3f *rotation, bool *force_visible) const override |
void | clearChildAttachments () override |
void | addAttachmentChild (object_t child_id) override |
void | removeAttachmentChild (object_t child_id) override |
const std::unordered_set< object_t > & | getAttachmentChildIds () const override |
ObjectProperties * | accessObjectProperties () override |
void | notifyObjectPropertiesModified () override |
void | sendOutdatedData () |
std::string | generateUpdateAttachmentCommand () const |
std::string | generateUpdateAnimationSpeedCommand () const |
std::string | generateUpdateAnimationCommand () const |
std::string | generateUpdateArmorGroupsCommand () const |
std::string | generateSetPropertiesCommand (const ObjectProperties &prop) const |
void | sendPunchCommand () |
Public Member Functions inherited from ServerActiveObject | |
ServerActiveObject (ServerEnvironment *env, v3f pos) | |
virtual | ~ServerActiveObject ()=default |
void | markForRemoval () |
void | markForDeactivation () |
v3f | getBasePosition () const |
void | setBasePosition (v3f pos) |
ServerEnvironment * | getEnv () |
virtual float | getMinimumSavedMovement () |
void | attachParticleSpawner (u32 id) |
void | detachParticleSpawner (u32 id) |
std::string | generateUpdateInfantCommand (u16 infant_id, u16 protocol_version) |
void | dumpAOMessagesToQueue (std::queue< ActiveObjectMessage > &queue) |
bool | isGone () const |
bool | isPendingRemoval () const |
void | invalidateEffectiveObservers () |
Invalidate final observer cache. | |
const Observers & | getEffectiveObservers () |
Cache m_effective_observers with the names of all observers, also indirect observers (object attachment chain). | |
const Observers & | recalculateEffectiveObservers () |
Force a recalculation of final observers (including all parents). | |
bool | isEffectivelyObservedBy (const std::string &player_name) |
Whether the object is sent to player_name | |
Public Member Functions inherited from ActiveObject | |
ActiveObject (object_t id) | |
object_t | getId () const |
void | setId (object_t id) |
virtual void | clearParentAttachment () |
Public Attributes | ||
struct { | ||
bool breathing: 1 | ||
bool drowning: 1 | ||
bool node_damage: 1 | ||
} | m_flags = {true, true, true} | |
bool | m_physics_override_sent = false | |
Public Attributes inherited from ServerActiveObject | ||
u16 | m_known_by_count = 0 | |
bool | m_static_exists = false | |
v3s16 | m_static_block = v3s16(1337,1337,1337) | |
Observers | m_observers | |
Private Member Functions | |
std::string | getPropertyPacket () |
void | unlinkPlayerSessionAndSave () |
std::string | generateUpdatePhysicsOverrideCommand () const |
Private Attributes | |
RemotePlayer * | m_player = nullptr |
session_t | m_peer_id_initial = 0 |
only used to initialize RemotePlayer | |
LagPool | m_dig_pool |
LagPool | m_move_pool |
v3f | m_last_good_position |
float | m_time_from_last_teleport = 0.0f |
float | m_time_from_last_punch = 0.0f |
v3s16 | m_nocheat_dig_pos = v3s16(32767, 32767, 32767) |
float | m_nocheat_dig_time = 0.0f |
float | m_max_speed_override_time = 0.0f |
v3f | m_max_speed_override = v3f(0.0f, 0.0f, 0.0f) |
IntervalLimiter | m_breathing_interval |
IntervalLimiter | m_drowning_interval |
IntervalLimiter | m_node_hurt_interval |
bool | m_position_not_sent = false |
std::set< std::string > | m_privs |
bool | m_is_singleplayer |
u16 | m_breath = PLAYER_MAX_BREATH_DEFAULT |
f32 | m_pitch = 0.0f |
f32 | m_fov = 0.0f |
s16 | m_wanted_range = 0.0f |
bool | m_camera_inverted = false |
SimpleMetadata | m_meta |
Additional Inherited Members | |
Public Types inherited from ServerActiveObject | |
using | Observers = std::optional<std::unordered_set<std::string>> |
Public Types inherited from ActiveObject | |
typedef u16 | object_t |
Static Public Member Functions inherited from UnitSAO | |
static std::string | generateUpdatePositionCommand (const v3f &position, const v3f &velocity, const v3f &acceleration, const v3f &rotation, bool do_interpolate, bool is_movement_end, f32 update_interval) |
static std::string | generateUpdateBoneOverrideCommand (const std::string &bone, const BoneOverride &props) |
Protected Member Functions inherited from UnitSAO | |
void | clearAnyAttachments () |
virtual void | onMarkedForDeactivation () override |
virtual void | onMarkedForRemoval () override |
Protected Attributes inherited from UnitSAO | |
u16 | m_hp = 1 |
v3f | m_rotation |
f32 | m_rotation_add_yaw = 0 |
ItemGroupList | m_armor_groups |
bool | m_properties_sent = true |
ObjectProperties | m_prop |
std::unordered_map< std::string, BoneOverride > | m_bone_override |
object_t | m_attachment_parent_id = 0 |
Protected Attributes inherited from ServerActiveObject | |
std::optional< Observers > | m_effective_observers |
ServerEnvironment * | m_env |
v3f | m_base_position |
std::unordered_set< u32 > | m_attached_particle_spawners |
bool | m_pending_deactivation = false |
bool | m_pending_removal = false |
std::queue< ActiveObjectMessage > | m_messages_out |
Protected Attributes inherited from ActiveObject | |
object_t | m_id |
PlayerSAO::PlayerSAO | ( | ServerEnvironment * | env_, |
RemotePlayer * | player_, | ||
session_t | peer_id_, | ||
bool | is_singleplayer ) |
References ObjectProperties::backface_culling, ObjectProperties::breath_max, BS, ObjectProperties::collisionbox, ObjectProperties::colors, ObjectProperties::eye_height, g_settings, Settings::getBool(), ObjectProperties::hp_max, ObjectProperties::is_visible, UnitSAO::m_armor_groups, m_breath, UnitSAO::m_hp, m_peer_id_initial, UnitSAO::m_prop, ObjectProperties::makes_footstep_sound, PEER_ID_INEXISTENT, ObjectProperties::physical, PLAYER_DEFAULT_STEPHEIGHT, PLAYER_MAX_BREATH_DEFAULT, PLAYER_MAX_HP_DEFAULT, POINTABLE, ObjectProperties::pointable, SANITY_CHECK, ObjectProperties::selectionbox, ObjectProperties::show_on_minimap, ObjectProperties::spritediv, ObjectProperties::stepheight, ObjectProperties::textures, ObjectProperties::visual, ObjectProperties::visual_size, and ObjectProperties::zoom_fov.
|
overridevirtual |
Reimplemented from ServerActiveObject.
References ServerActiveObject::addedToEnvironment(), ServerActiveObject::m_base_position, m_last_good_position, m_peer_id_initial, m_player, PEER_ID_INEXISTENT, ServerActiveObject::setBasePosition(), RemotePlayer::setPeerId(), and RemotePlayer::setPlayerSAO().
|
overridevirtual |
Reimplemented from ServerActiveObject.
References LagPool::empty(), ServerActiveObject::getBasePosition(), ServerEnvironment::getGameDef(), getPeerID(), UnitSAO::isAttached(), ServerActiveObject::m_env, m_last_good_position, m_move_pool, m_player, m_time_from_last_teleport, MAP_BLOCKSIZE, RemotePlayer::protocol_version, Server::SendBlock(), Server::SendMovePlayerRel(), setBasePosition(), and setPos().
bool PlayerSAO::checkMovementCheat | ( | ) |
References AC_MOVEMENT, actionstream, flagdesc_anticheat, g_settings, Settings::getFlagStr(), Settings::getFloat(), ServerEnvironment::getMaxLagEstimate(), Player::getName(), LagPool::grab(), UnitSAO::isAttached(), PlayerPhysicsOverride::jump, ServerActiveObject::m_base_position, ServerActiveObject::m_env, m_is_singleplayer, m_last_good_position, m_max_speed_override, m_max_speed_override_time, m_move_pool, m_player, m_privs, m_time_from_last_teleport, Player::movement_speed_climb, Player::movement_speed_crouch, Player::movement_speed_fast, Player::movement_speed_jump, Player::movement_speed_walk, MYMAX, Player::physics_override, setBasePosition(), PlayerPhysicsOverride::speed, PlayerPhysicsOverride::speed_climb, PlayerPhysicsOverride::speed_crouch, PlayerPhysicsOverride::speed_fast, and PlayerPhysicsOverride::speed_walk.
Referenced by Server::process_PlayerPos().
|
inlineoverridevirtual |
Implements ActiveObject.
void PlayerSAO::disconnected | ( | ) |
References m_player, ServerActiveObject::markForRemoval(), PEER_ID_INEXISTENT, and RemotePlayer::setPeerId().
Referenced by Server::DeleteClient().
void PlayerSAO::finalize | ( | RemotePlayer * | player, |
const std::set< std::string > & | privs ) |
References m_player, and m_privs.
Referenced by Server::emergePlayer(), and ServerEnvironment::migratePlayersDatabase().
|
private |
References AO_CMD_SET_PHYSICS_OVERRIDE, m_player, Player::physics_override, writeF32(), and writeU8().
Referenced by getClientInitializationData(), and step().
|
inline |
References m_breath.
Referenced by ObjectRef::l_get_breath(), read_object_properties(), PlayerDatabaseLevelDB::savePlayer(), PlayerDatabaseSQLite3::savePlayer(), Server::SendPlayerBreath(), and PlayerDatabaseFiles::serialize().
|
inline |
References m_camera_inverted.
Referenced by RemoteClient::GetNextBlocks().
|
overridevirtual |
Reimplemented from ServerActiveObject.
References UnitSAO::generateUpdateAnimationCommand(), UnitSAO::generateUpdateArmorGroupsCommand(), UnitSAO::generateUpdateAttachmentCommand(), UnitSAO::generateUpdateBoneOverrideCommand(), generateUpdatePhysicsOverrideCommand(), ServerEnvironment::getActiveObject(), UnitSAO::getAttachmentChildIds(), UnitSAO::getHP(), ActiveObject::getId(), Player::getName(), getPropertyPacket(), ServerActiveObject::m_base_position, UnitSAO::m_bone_override, ServerActiveObject::m_env, m_player, UnitSAO::m_rotation, serializeString16(), serializeString32(), writeS16(), writeU16(), writeU8(), and writeV3F32().
|
overridevirtual |
Returns the collision box of the object. This box is translated by the object's location. The box's coordinates are world coordinates.
Implements ActiveObject.
References BS, ObjectProperties::collisionbox, ServerActiveObject::m_base_position, and UnitSAO::m_prop.
|
overridevirtual |
Reimplemented from ServerActiveObject.
References Player::getName(), and m_player.
Referenced by punch().
|
inline |
References m_dig_pool.
Referenced by Server::handleCommand_Interact().
v3f PlayerSAO::getEyeOffset | ( | ) | const |
References BS, ObjectProperties::eye_height, and UnitSAO::m_prop.
Referenced by getEyePosition(), and Server::handleCommand_Interact().
|
inline |
References getEyeOffset(), and ServerActiveObject::m_base_position.
Referenced by RemoteClient::GetNextBlocks(), Server::handleCommand_Interact(), Server::handleCommand_InventoryAction(), and step().
|
inline |
References m_fov.
Referenced by RemoteClient::GetNextBlocks().
|
overridevirtual |
Reimplemented from ServerActiveObject.
References Player::inventory, and m_player.
Referenced by ServerInventoryManager::getInventory(), and PlayerDatabaseSQLite3::savePlayer().
|
overridevirtual |
Reimplemented from ServerActiveObject.
References Player::getName(), m_player, and InventoryLocation::setPlayer().
|
inline |
References m_last_good_position.
Referenced by Server::handleCommand_Interact().
|
inline |
References m_pitch.
Referenced by RemoteClient::GetNextBlocks(), PlayerDatabaseLevelDB::savePlayer(), PlayerDatabaseSQLite3::savePlayer(), Server::SendMovePlayer(), and PlayerDatabaseFiles::serialize().
|
inline |
References m_meta.
Referenced by PlayerDatabaseFiles::deSerialize(), PlayerMetaRef::getmeta(), ObjectRef::l_get_attribute(), ObjectRef::l_set_attribute(), PlayerDatabaseLevelDB::loadPlayer(), PlayerDatabaseSQLite3::loadPlayer(), RemotePlayer::onSuccessfulSave(), PlayerDatabaseLevelDB::savePlayer(), PlayerDatabaseSQLite3::savePlayer(), and PlayerDatabaseFiles::serialize().
|
inline |
References m_nocheat_dig_pos.
Referenced by Server::handleCommand_Interact().
|
inline |
References m_nocheat_dig_time.
Referenced by Server::handleCommand_Interact().
session_t PlayerSAO::getPeerID | ( | ) | const |
References RemotePlayer::getPeerId(), m_player, and PEER_ID_INEXISTENT.
Referenced by addPos(), ObjectRef::l_add_velocity(), Server::SendMovePlayer(), Server::SendPlayerBreath(), Server::SendPlayerHP(), and setPos().
|
inline |
References m_player.
Referenced by ServerEnvironment::getAddedActiveObjects(), RemoteClient::GetNextBlocks(), ObjectRef::getplayer(), ServerEnvironment::getRemovedActiveObjects(), Server::handleCommand_ClientReady(), Server::handleCommand_PlayerItem(), Server::HandlePlayerDeath(), ObjectRef::l_get_meta(), ObjectRef::l_set_physics_override(), and PlayerDatabaseSQLite3::loadPlayer().
|
private |
References UnitSAO::generateSetPropertiesCommand(), ObjectProperties::is_visible, and UnitSAO::m_prop.
Referenced by getClientInitializationData(), and step().
|
inline |
References m_pitch.
Referenced by ObjectRef::l_get_look_vertical().
|
inline |
References m_pitch.
Referenced by ObjectRef::l_get_look_dir(), and ObjectRef::l_get_look_pitch().
|
overridevirtual |
Returns the selection box of the object. This box is not translated when the object moves. The box's coordinates are world coordinates.
Implements ActiveObject.
References BS, ObjectProperties::is_visible, UnitSAO::m_prop, and ObjectProperties::selectionbox.
|
inlineoverridevirtual |
Reimplemented from ServerActiveObject.
References ACTIVEOBJECT_TYPE_GENERIC.
|
overridevirtual |
Reimplemented from ServerActiveObject.
References FATAL_ERROR.
|
inlineoverridevirtual |
Implements ActiveObject.
References ACTIVEOBJECT_TYPE_PLAYER.
|
inline |
References m_wanted_range.
Referenced by RemoteClient::GetNextBlocks(), and Server::SendActiveObjectRemoveAdd().
|
overridevirtual |
Reimplemented from ServerActiveObject.
References Player::getWieldedItem(), and m_player.
Referenced by getWieldedItem(), and Server::handleCommand_Interact().
|
overridevirtual |
Reimplemented from ServerActiveObject.
References Player::getWieldIndex(), and m_player.
|
inlineoverridevirtual |
Reimplemented from ServerActiveObject.
Referenced by setWieldedItem().
float PlayerSAO::getZoomFOV | ( | ) | const |
References UnitSAO::m_prop, and ObjectProperties::zoom_fov.
Referenced by RemoteClient::GetNextBlocks().
|
inlineoverridevirtual |
Reimplemented from ServerActiveObject.
|
overridevirtual |
Reimplemented from ServerActiveObject.
References LagPool::empty(), ServerActiveObject::getBasePosition(), ServerEnvironment::getGameDef(), UnitSAO::isAttached(), ServerActiveObject::m_env, m_last_good_position, m_move_pool, m_time_from_last_teleport, Server::SendMovePlayer(), and setBasePosition().
|
inline |
References m_nocheat_dig_pos.
Referenced by Server::handleCommand_Interact().
|
inline |
References m_nocheat_dig_pos, m_nocheat_dig_time, and p().
Referenced by Server::handleCommand_Interact().
|
overridevirtual |
Reimplemented from ServerActiveObject.
References actionstream, ACTIVEOBJECT_TYPE_PLAYER, dir(), g_settings, Settings::getBool(), getDescription(), ServerActiveObject::getDescription(), getHitParams(), ServerActiveObject::getHP(), UnitSAO::getHP(), ActiveObject::getId(), RemotePlayer::getPlayerSAO(), ServerEnvironment::getScriptIface(), ActiveObject::getType(), HitParams::hp, UnitSAO::isImmortal(), UnitSAO::m_armor_groups, ServerActiveObject::m_env, UnitSAO::m_hp, ActiveObject::m_id, m_player, ScriptApiPlayer::on_punchplayer(), PlayerHPChangeReason::PLAYER_PUNCH, UnitSAO::sendPunchCommand(), setHP(), and HitParams::wear.
|
overridevirtual |
Reimplemented from ServerActiveObject.
References ServerEnvironment::deleteParticleSpawner(), RemotePlayer::getPlayerSAO(), ServerActiveObject::m_attached_particle_spawners, ServerActiveObject::m_env, m_player, ServerActiveObject::removingFromEnvironment(), SANITY_CHECK, and unlinkPlayerSessionAndSave().
|
inline |
References m_time_from_last_punch.
Referenced by Server::handleCommand_Interact().
void PlayerSAO::respawn | ( | ) |
References ObjectProperties::breath_max, Server::findSpawnPos(), ServerEnvironment::getGameDef(), Player::getName(), ServerEnvironment::getScriptIface(), ObjectProperties::hp_max, infostream, ServerActiveObject::m_env, m_player, UnitSAO::m_prop, ScriptApiPlayer::on_respawnplayer(), PlayerHPChangeReason::RESPAWN, setBreath(), setHP(), and setPos().
|
overridevirtual |
Reimplemented from ServerActiveObject.
References ServerEnvironment::getScriptIface(), ServerActiveObject::m_env, and ScriptApiPlayer::on_rightclickplayer().
void PlayerSAO::setBasePosition | ( | v3f | position | ) |
References ServerActiveObject::m_base_position, ServerActiveObject::m_env, m_player, m_position_not_sent, ServerActiveObject::setBasePosition(), and RemotePlayer::setDirty().
Referenced by addPos(), checkMovementCheat(), PlayerDatabaseFiles::deSerialize(), PlayerDatabaseLevelDB::loadPlayer(), PlayerDatabaseSQLite3::loadPlayer(), moveTo(), Server::process_PlayerPos(), setPos(), and step().
void PlayerSAO::setBreath | ( | const u16 | breath, |
bool | send = true ) |
References ObjectProperties::breath_max, ServerEnvironment::getGameDef(), m_breath, ServerActiveObject::m_env, m_player, UnitSAO::m_prop, rangelim, Server::SendPlayerBreath(), and RemotePlayer::setDirty().
Referenced by PlayerDatabaseFiles::deSerialize(), ObjectRef::l_set_breath(), PlayerDatabaseLevelDB::loadPlayer(), PlayerDatabaseSQLite3::loadPlayer(), read_object_properties(), respawn(), and step().
|
inline |
References m_camera_inverted.
Referenced by Server::process_PlayerPos().
void PlayerSAO::setFov | ( | const float | pitch | ) |
References m_fov, m_player, and RemotePlayer::setDirty().
Referenced by Server::process_PlayerPos().
|
inlineoverridevirtual |
Reimplemented from ServerActiveObject.
References setHP().
Referenced by Server::handleCommand_Damage(), punch(), respawn(), setHP(), and step().
void PlayerSAO::setHP | ( | s32 | hp, |
const PlayerHPChangeReason & | reason, | ||
bool | from_client ) |
References ServerEnvironment::getGameDef(), ServerEnvironment::getScriptIface(), Server::HandlePlayerHPChange(), ObjectProperties::hp_max, UnitSAO::isImmortal(), ServerActiveObject::m_env, UnitSAO::m_hp, UnitSAO::m_prop, UnitSAO::m_properties_sent, ScriptApiPlayer::on_player_hpchange(), rangelim, S32_MIN, Server::SendPlayerHP(), and U16_MAX.
|
inline |
References UnitSAO::m_hp.
Referenced by PlayerDatabaseFiles::deSerialize(), PlayerDatabaseLevelDB::loadPlayer(), and PlayerDatabaseSQLite3::loadPlayer().
|
inlineoverridevirtual |
Reimplemented from ServerActiveObject.
void PlayerSAO::setLookPitch | ( | const float | pitch | ) |
References m_pitch, m_player, and RemotePlayer::setDirty().
Referenced by PlayerDatabaseFiles::deSerialize(), PlayerDatabaseLevelDB::loadPlayer(), PlayerDatabaseSQLite3::loadPlayer(), Server::process_PlayerPos(), and setLookPitchAndSend().
void PlayerSAO::setLookPitchAndSend | ( | const float | pitch | ) |
References ServerEnvironment::getGameDef(), ServerActiveObject::m_env, Server::SendMovePlayer(), and setLookPitch().
Referenced by ObjectRef::l_set_look_pitch(), and ObjectRef::l_set_look_vertical().
void PlayerSAO::setMaxSpeedOverride | ( | const v3f & | vel | ) |
References BS, m_max_speed_override, m_max_speed_override_time, m_player, Player::movement_acceleration_air, Player::movement_acceleration_default, and MYMIN.
Referenced by ObjectRef::l_add_velocity().
|
inline |
References m_player.
Referenced by RemotePlayer::~RemotePlayer().
void PlayerSAO::setPlayerYaw | ( | const float | yaw | ) |
References m_player, UnitSAO::m_rotation, RemotePlayer::setDirty(), and UnitSAO::setRotation().
Referenced by PlayerDatabaseFiles::deSerialize(), PlayerDatabaseLevelDB::loadPlayer(), PlayerDatabaseSQLite3::loadPlayer(), Server::process_PlayerPos(), and setPlayerYawAndSend().
void PlayerSAO::setPlayerYawAndSend | ( | const float | yaw | ) |
References ServerEnvironment::getGameDef(), ServerActiveObject::m_env, Server::SendMovePlayer(), and setPlayerYaw().
Referenced by ObjectRef::l_set_look_horizontal(), and ObjectRef::l_set_look_yaw().
|
overridevirtual |
Reimplemented from ServerActiveObject.
References LagPool::empty(), ServerActiveObject::getBasePosition(), ServerEnvironment::getGameDef(), getPeerID(), UnitSAO::isAttached(), ServerActiveObject::m_env, m_last_good_position, m_move_pool, m_time_from_last_teleport, MAP_BLOCKSIZE, Server::SendBlock(), Server::SendMovePlayer(), and setBasePosition().
Referenced by addPos(), respawn(), and step().
void PlayerSAO::setWantedRange | ( | const s16 | range | ) |
References m_player, m_wanted_range, and RemotePlayer::setDirty().
Referenced by Server::process_PlayerPos().
|
overridevirtual |
Reimplemented from ServerActiveObject.
References InventoryList::changeItem(), Inventory::getList(), Player::getWieldIndex(), getWieldList(), Player::inventory, and m_player.
Referenced by Server::handleCommand_Interact().
|
inlineoverridevirtual |
Reimplemented from ServerActiveObject.
|
overridevirtual |
Reimplemented from ServerActiveObject.
References LagPool::add(), ObjectProperties::breath_max, BS, ActiveObject::clearParentAttachment(), ObjectProperties::collisionbox, CONTENT_IGNORE, ContentFeatures::damage_per_second, PlayerHPChangeReason::DROWNING, ContentFeatures::drowning, floatToInt(), generateUpdatePhysicsOverrideCommand(), UnitSAO::generateUpdatePositionCommand(), NodeDefManager::get(), MapNode::getContent(), getEyePosition(), ServerEnvironment::getGameDef(), ActiveObject::getId(), ServerEnvironment::getMap(), ServerEnvironment::getMaxLagEstimate(), Map::getNode(), UnitSAO::getParent(), getPropertyPacket(), ServerEnvironment::getScriptIface(), ServerEnvironment::getSendRecommendedInterval(), UnitSAO::isAttached(), UnitSAO::isImmortal(), UnitSAO::m_attachment_parent_id, ServerActiveObject::m_base_position, m_breath, m_breathing_interval, m_dig_pool, m_drowning_interval, ServerActiveObject::m_env, m_flags, UnitSAO::m_hp, ActiveObject::m_id, m_last_good_position, m_max_speed_override_time, ServerActiveObject::m_messages_out, m_move_pool, m_nocheat_dig_time, m_node_hurt_interval, m_physics_override_sent, m_player, m_position_not_sent, UnitSAO::m_prop, UnitSAO::m_properties_sent, UnitSAO::m_rotation, m_time_from_last_punch, m_time_from_last_teleport, MYMAX, ContentFeatures::name, IGameDef::ndef(), PlayerHPChangeReason::NODE_DAMAGE, p(), ScriptApiEnv::player_event(), UnitSAO::sendOutdatedData(), setBasePosition(), setBreath(), setHP(), LagPool::setMax(), setPos(), Player::setSpeed(), IntervalLimiter::step(), and warningstream.
|
private |
References RemotePlayer::getPlayerSAO(), ServerActiveObject::m_env, m_player, ServerEnvironment::removePlayer(), and ServerEnvironment::savePlayer().
Referenced by removingFromEnvironment().
|
inline |
References m_is_singleplayer, and m_privs.
Referenced by Server::reportPrivsModified().
bool PlayerSAO::breathing |
bool PlayerSAO::drowning |
|
private |
Referenced by PlayerSAO(), getBreath(), setBreath(), and step().
|
private |
Referenced by step().
|
private |
Referenced by getCameraInverted(), and setCameraInverted().
|
private |
Referenced by getDigPool(), and step().
|
private |
Referenced by step().
struct { ... } PlayerSAO::m_flags |
Referenced by step().
|
private |
Referenced by checkMovementCheat(), and updatePrivileges().
|
private |
Referenced by addedToEnvironment(), addPos(), checkMovementCheat(), getLastGoodPosition(), moveTo(), setPos(), and step().
Referenced by checkMovementCheat(), and setMaxSpeedOverride().
|
private |
Referenced by checkMovementCheat(), setMaxSpeedOverride(), and step().
|
private |
Referenced by getMeta().
|
private |
Referenced by addPos(), checkMovementCheat(), moveTo(), setPos(), and step().
Referenced by getNoCheatDigPos(), noCheatDigEnd(), and noCheatDigStart().
|
private |
Referenced by getNoCheatDigTime(), noCheatDigStart(), and step().
|
private |
Referenced by step().
|
private |
only used to initialize RemotePlayer
Referenced by PlayerSAO(), and addedToEnvironment().
bool PlayerSAO::m_physics_override_sent = false |
Referenced by ObjectRef::l_set_physics_override(), and step().
|
private |
Referenced by getLookPitch(), getRadLookPitch(), getRadLookPitchDep(), and setLookPitch().
|
private |
Referenced by addedToEnvironment(), addPos(), checkMovementCheat(), disconnected(), finalize(), generateUpdatePhysicsOverrideCommand(), getClientInitializationData(), getDescription(), getInventory(), getInventoryLocation(), getPeerID(), getPlayer(), getWieldedItem(), getWieldIndex(), punch(), removingFromEnvironment(), respawn(), setBasePosition(), setBreath(), setFov(), setLookPitch(), setMaxSpeedOverride(), setPlayer(), setPlayerYaw(), setWantedRange(), setWieldedItem(), step(), and unlinkPlayerSessionAndSave().
|
private |
Referenced by setBasePosition(), and step().
|
private |
Referenced by checkMovementCheat(), finalize(), and updatePrivileges().
|
private |
Referenced by resetTimeFromLastPunch(), and step().
|
private |
Referenced by addPos(), checkMovementCheat(), moveTo(), setPos(), and step().
|
private |
Referenced by getWantedRange(), and setWantedRange().
bool PlayerSAO::node_damage |