#include <serveractiveobject.h>
Public Member Functions | |
ServerActiveObject (ServerEnvironment *env, v3f pos) | |
virtual | ~ServerActiveObject ()=default |
virtual ActiveObjectType | getSendType () const |
virtual void | addedToEnvironment (u32 dtime_s) |
virtual void | removingFromEnvironment () |
virtual bool | environmentDeletes () const |
void | markForRemoval () |
void | markForDeactivation () |
v3f | getBasePosition () const |
void | setBasePosition (v3f pos) |
ServerEnvironment * | getEnv () |
virtual void | setPos (const v3f &pos) |
virtual void | moveTo (v3f pos, bool continuous) |
virtual float | getMinimumSavedMovement () |
virtual std::string | getDescription () |
virtual void | step (float dtime, bool send_recommended) |
virtual std::string | getClientInitializationData (u16 protocol_version) |
virtual void | getStaticData (std::string *result) const |
virtual bool | isStaticAllowed () const |
virtual bool | shouldUnload () const |
virtual u16 | punch (v3f dir, const ToolCapabilities *toolcap=nullptr, ServerActiveObject *puncher=nullptr, float time_from_last_punch=1000000.0f) |
virtual void | rightClick (ServerActiveObject *clicker) |
virtual void | setHP (s32 hp, const PlayerHPChangeReason &reason) |
virtual u16 | getHP () const |
virtual void | setArmorGroups (const ItemGroupList &armor_groups) |
virtual const ItemGroupList & | getArmorGroups () const |
virtual void | setAnimation (v2f frames, float frame_speed, float frame_blend, bool frame_loop) |
virtual void | getAnimation (v2f *frames, float *frame_speed, float *frame_blend, bool *frame_loop) |
virtual void | setAnimationSpeed (float frame_speed) |
virtual void | setBonePosition (const std::string &bone, v3f position, v3f rotation) |
virtual void | getBonePosition (const std::string &bone, v3f *position, v3f *lotation) |
virtual const std::unordered_set< int > & | getAttachmentChildIds () const |
virtual ServerActiveObject * | getParent () const |
virtual ObjectProperties * | accessObjectProperties () |
virtual void | notifyObjectPropertiesModified () |
virtual Inventory * | getInventory () const |
virtual InventoryLocation | getInventoryLocation () const |
virtual void | setInventoryModified () |
virtual std::string | getWieldList () const |
virtual u16 | getWieldIndex () const |
virtual ItemStack | getWieldedItem (ItemStack *selected, ItemStack *hand=nullptr) const |
virtual bool | setWieldedItem (const ItemStack &item) |
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 |
Public Member Functions inherited from ActiveObject | |
ActiveObject (u16 id) | |
u16 | getId () const |
void | setId (u16 id) |
virtual ActiveObjectType | getType () const =0 |
virtual bool | getCollisionBox (aabb3f *toset) const =0 |
virtual bool | getSelectionBox (aabb3f *toset) const =0 |
virtual bool | collideWithObjects () const =0 |
virtual void | setAttachment (int parent_id, const std::string &bone, v3f position, v3f rotation, bool force_visible) |
virtual void | getAttachment (int *parent_id, std::string *bone, v3f *position, v3f *rotation, bool *force_visible) const |
virtual void | clearChildAttachments () |
virtual void | clearParentAttachment () |
virtual void | addAttachmentChild (int child_id) |
virtual void | removeAttachmentChild (int child_id) |
Static Public Member Functions | |
static ServerActiveObject * | create (ActiveObjectType type, ServerEnvironment *env, u16 id, v3f pos, const std::string &data) |
Public Attributes | |
u16 | m_known_by_count = 0 |
bool | m_static_exists = false |
v3s16 | m_static_block = v3s16(1337,1337,1337) |
Protected Member Functions | |
virtual void | onMarkedForDeactivation () |
virtual void | onMarkedForRemoval () |
virtual void | onAttach (int parent_id) |
virtual void | onDetach (int parent_id) |
Protected Attributes | |
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 | |
u16 | m_id |
ServerActiveObject::ServerActiveObject | ( | ServerEnvironment * | env, |
v3f | pos | ||
) |
|
virtualdefault |
|
inlinevirtual |
Reimplemented in UnitSAO.
Referenced by ObjectRef::l_get_nametag_attributes(), ObjectRef::l_get_properties(), ObjectRef::l_set_nametag_attributes(), and ObjectRef::l_set_properties().
|
inlinevirtual |
Reimplemented in PlayerSAO, and LuaEntitySAO.
Referenced by LuaEntitySAO::addedToEnvironment(), and PlayerSAO::addedToEnvironment().
|
inline |
References m_attached_particle_spawners.
|
static |
|
inline |
References m_attached_particle_spawners.
Referenced by ServerEnvironment::deleteParticleSpawner().
void ServerActiveObject::dumpAOMessagesToQueue | ( | std::queue< ActiveObjectMessage > & | queue | ) |
References m_messages_out.
|
inlinevirtual |
Referenced by ServerEnvironment::clearObjects(), ServerEnvironment::deactivateFarObjects(), server::ActiveObjectMgr::registerObject(), and ServerEnvironment::removeRemovedObjects().
std::string ServerActiveObject::generateUpdateInfantCommand | ( | u16 | infant_id, |
u16 | protocol_version | ||
) |
References AO_CMD_SPAWN_INFANT, getClientInitializationData(), getSendType(), serializeString32(), writeU16(), and writeU8().
|
inlinevirtual |
Reimplemented in UnitSAO.
Referenced by ObjectRef::l_get_animation().
|
inlinevirtual |
Reimplemented in UnitSAO.
Referenced by ObjectRef::l_get_armor_groups().
|
inlinevirtual |
Reimplemented in UnitSAO.
Referenced by ObjectRef::l_get_children().
|
inline |
References m_base_position.
Referenced by IDropAction::apply(), ICraftAction::apply(), ServerEnvironment::deactivateFarObjects(), ServerEnvironment::getAddedActiveObjects(), server::ActiveObjectMgr::getAddedActiveObjectsAroundPos(), RemoteClient::GetNextBlocks(), server::ActiveObjectMgr::getObjectsInArea(), server::ActiveObjectMgr::getObjectsInsideRadius(), ServerSoundParams::getPos(), ServerEnvironment::getRemovedActiveObjects(), Server::handleCommand_Damage(), Server::handleCommand_Interact(), Server::handleCommand_Respawn(), ObjectRef::l_get_pos(), ObjectRef::l_punch(), ServerEnvironment::loadPlayer(), Server::playSound(), server::ActiveObjectMgr::registerObject(), PlayerDatabaseLevelDB::savePlayer(), PlayerDatabaseSQLite3::savePlayer(), Server::sendAddNode(), Server::SendAddParticleSpawner(), Server::sendMetadataChanged(), Server::SendMovePlayer(), Server::sendRemoveNode(), Server::SendSpawnParticle(), and PlayerDatabaseFiles::serialize().
|
inlinevirtual |
Reimplemented in UnitSAO.
Referenced by ObjectRef::l_get_bone_position().
|
inlinevirtual |
Reimplemented in PlayerSAO, and LuaEntitySAO.
Referenced by generateUpdateInfantCommand(), and Server::SendActiveObjectRemoveAdd().
|
inlinevirtual |
Reimplemented in PlayerSAO, and LuaEntitySAO.
Referenced by ICraftAction::apply(), Server::handleCommand_Interact(), PlayerSAO::punch(), and LuaEntitySAO::punch().
|
inline |
References m_env.
Referenced by read_object_properties().
|
inlinevirtual |
Reimplemented in UnitSAO, and LuaEntitySAO.
Referenced by Server::handleCommand_Interact(), ObjectRef::l_get_hp(), ObjectRef::l_punch(), PlayerSAO::punch(), LuaEntitySAO::punch(), and read_object_properties().
|
inlinevirtual |
Reimplemented in PlayerSAO.
|
inlinevirtual |
Reimplemented in PlayerSAO.
Referenced by ObjectRef::l_get_inventory().
|
virtual |
Reimplemented in LuaEntitySAO.
References BS.
Referenced by ServerEnvironment::deactivateFarObjects().
|
inlinevirtual |
Reimplemented in UnitSAO.
Referenced by Server::AsyncRunStep().
|
inlinevirtual |
Reimplemented in PlayerSAO, and LuaEntitySAO.
References ActiveObject::getType().
Referenced by generateUpdateInfantCommand(), and Server::SendActiveObjectRemoveAdd().
|
inlinevirtual |
Reimplemented in PlayerSAO, and LuaEntitySAO.
References isStaticAllowed().
Referenced by StaticObject::StaticObject().
|
virtual |
Reimplemented in PlayerSAO.
Referenced by ObjectRef::l_get_wielded_item(), and LuaEntitySAO::punch().
|
inlinevirtual |
Reimplemented in PlayerSAO.
Referenced by ObjectRef::l_get_wield_index().
|
inlinevirtual |
Reimplemented in PlayerSAO.
Referenced by ObjectRef::l_get_wield_list().
|
inline |
References m_pending_deactivation, and m_pending_removal.
Referenced by ServerEnvironment::deactivateFarObjects(), LuaEntitySAO::dispatchScriptDeactivate(), server::ActiveObjectMgr::getAddedActiveObjectsAroundPos(), ObjectRef::getobject(), ServerEnvironment::getRemovedActiveObjects(), Server::handleCommand_Interact(), ModApiEnvMod::l_add_entity(), ModApiEnvMod::l_get_connected_players(), ModApiEnvMod::l_get_player_by_name(), ScriptApiBase::objectrefGetOrCreate(), UnitSAO::onAttach(), UnitSAO::onDetach(), LuaEntitySAO::punch(), and ServerEnvironment::removeRemovedObjects().
|
inline |
References m_pending_removal.
Referenced by ServerEnvironment::removeRemovedObjects().
|
inlinevirtual |
Reimplemented in PlayerSAO, and LuaEntitySAO.
Referenced by ServerEnvironment::addActiveObjectRaw(), ServerEnvironment::deactivateFarObjects(), and getStaticData().
void ServerActiveObject::markForDeactivation | ( | ) |
References m_pending_deactivation, and onMarkedForDeactivation().
Referenced by ServerEnvironment::deactivateFarObjects().
void ServerActiveObject::markForRemoval | ( | ) |
References m_pending_removal, and onMarkedForRemoval().
Referenced by ServerEnvironment::clearObjects(), PlayerSAO::disconnected(), ObjectRef::l_remove(), and LuaEntitySAO::punch().
|
inlinevirtual |
Reimplemented in PlayerSAO, and LuaEntitySAO.
References setBasePosition().
Referenced by ObjectRef::l_move_to().
|
inlinevirtual |
Reimplemented in UnitSAO.
Referenced by ObjectRef::l_set_nametag_attributes(), and ObjectRef::l_set_properties().
|
inlineprotectedvirtual |
Reimplemented in UnitSAO.
|
inlineprotectedvirtual |
Reimplemented in UnitSAO.
|
inlineprotectedvirtual |
Reimplemented in LuaEntitySAO.
Referenced by markForDeactivation().
|
inlineprotectedvirtual |
Reimplemented in LuaEntitySAO.
Referenced by markForRemoval().
|
inlinevirtual |
Reimplemented in LuaEntitySAO, and PlayerSAO.
Referenced by Server::handleCommand_Interact(), and ObjectRef::l_punch().
|
inlinevirtual |
Reimplemented in PlayerSAO.
Referenced by ServerEnvironment::clearObjects(), ServerEnvironment::deactivateFarObjects(), ServerEnvironment::removeRemovedObjects(), and PlayerSAO::removingFromEnvironment().
|
inlinevirtual |
Reimplemented in PlayerSAO, and LuaEntitySAO.
Referenced by Server::handleCommand_Interact(), and ObjectRef::l_right_click().
|
inlinevirtual |
Reimplemented in UnitSAO.
Referenced by ObjectRef::l_set_animation().
|
inlinevirtual |
Reimplemented in UnitSAO.
Referenced by ObjectRef::l_set_animation_frame_speed().
|
inlinevirtual |
Reimplemented in UnitSAO.
Referenced by ObjectRef::l_set_armor_groups().
|
inline |
References m_base_position.
Referenced by PlayerSAO::addedToEnvironment(), moveTo(), PlayerSAO::setBasePosition(), and setPos().
|
inlinevirtual |
Reimplemented in UnitSAO.
Referenced by ObjectRef::l_set_bone_position().
|
inlinevirtual |
Reimplemented in PlayerSAO, and LuaEntitySAO.
Referenced by ObjectRef::l_set_hp(), and read_object_properties().
|
inlinevirtual |
Reimplemented in PlayerSAO.
|
inlinevirtual |
Reimplemented in PlayerSAO, and LuaEntitySAO.
References setBasePosition().
Referenced by ObjectRef::l_set_pos().
|
virtual |
Reimplemented in PlayerSAO.
Referenced by ObjectRef::l_set_wielded_item().
|
inlinevirtual |
Reimplemented in PlayerSAO, and LuaEntitySAO.
Referenced by ServerEnvironment::deactivateFarObjects().
|
inlinevirtual |
Reimplemented in PlayerSAO, and LuaEntitySAO.
|
protected |
|
protected |
Referenced by PlayerSAO::addedToEnvironment(), PlayerSAO::checkMovementCheat(), getBasePosition(), LuaEntitySAO::getClientInitializationData(), PlayerSAO::getClientInitializationData(), LuaEntitySAO::getCollisionBox(), PlayerSAO::getCollisionBox(), LuaEntitySAO::getDescription(), PlayerSAO::getEyePosition(), LuaEntitySAO::moveTo(), LuaEntitySAO::sendPosition(), PlayerSAO::setBasePosition(), setBasePosition(), LuaEntitySAO::setPos(), LuaEntitySAO::step(), and PlayerSAO::step().
|
protected |
Referenced by LuaEntitySAO::~LuaEntitySAO(), LuaEntitySAO::addedToEnvironment(), PlayerSAO::checkMovementCheat(), UnitSAO::clearChildAttachments(), UnitSAO::clearParentAttachment(), LuaEntitySAO::dispatchScriptDeactivate(), LuaEntitySAO::getClientInitializationData(), PlayerSAO::getClientInitializationData(), getEnv(), UnitSAO::getParent(), LuaEntitySAO::getStaticData(), PlayerSAO::moveTo(), UnitSAO::onAttach(), UnitSAO::onDetach(), PlayerSAO::punch(), LuaEntitySAO::punch(), PlayerSAO::removingFromEnvironment(), LuaEntitySAO::rightClick(), PlayerSAO::rightClick(), LuaEntitySAO::sendPosition(), PlayerSAO::setBasePosition(), PlayerSAO::setBreath(), PlayerSAO::setHP(), PlayerSAO::setLookPitchAndSend(), PlayerSAO::setPlayerYawAndSend(), PlayerSAO::setPos(), LuaEntitySAO::step(), PlayerSAO::step(), and PlayerSAO::unlinkPlayerSessionAndSave().
u16 ServerActiveObject::m_known_by_count = 0 |
|
protected |
|
protected |
Referenced by isGone(), and markForDeactivation().
|
protected |
Referenced by isGone(), isPendingRemoval(), and markForRemoval().
bool ServerActiveObject::m_static_exists = false |