59 bool is_singleplayer);
75 void step(
float dtime,
bool send_recommended)
override;
78 void addPos(
const v3f &added_pos)
override;
79 void moveTo(
v3f pos,
bool continuous)
override;
90 void setFov(
const float pitch);
102 float time_from_last_punch, u16 initial_wear = 0)
override;
106 return setHP(hp, reason,
false);
111 void setBreath(
const u16 breath,
bool send =
true);
253 if (typestr ==
"set_hp")
255 else if (typestr ==
"punch")
257 else if (typestr ==
"fall")
259 else if (typestr ==
"node_damage")
261 else if (typestr ==
"drown")
263 else if (typestr ==
"respawn")
282 return "node_damage";
ActiveObjectType
Definition activeobject.h:14
@ ACTIVEOBJECT_TYPE_PLAYER
Definition activeobject.h:26
@ ACTIVEOBJECT_TYPE_GENERIC
Definition activeobject.h:28
static v2f dir(const v2f &pos_dist)
Definition camera.cpp:191
Definition inventory.h:314
Definition player_sao.h:19
float m_max
Definition player_sao.h:21
bool grab(float dtime)
Definition player_sao.h:42
void add(float dtime)
Definition player_sao.h:33
void empty()
Definition player_sao.h:40
float m_pool
Definition player_sao.h:20
void setMax(float new_max)
Definition player_sao.h:26
Definition player_sao.h:56
void setPlayerYawAndSend(const float yaw)
Definition player_sao.cpp:428
std::string generateUpdatePhysicsOverrideCommand() const
Definition player_sao.cpp:301
std::string getClientInitializationData(u16 protocol_version) override
Definition player_sao.cpp:95
void rightClick(ServerActiveObject *clicker) override
Definition player_sao.cpp:500
bool drowning
Definition player_sao.h:219
void setBasePosition(v3f position)
Definition player_sao.cpp:334
void disconnected()
Definition player_sao.cpp:594
s16 getWantedRange() const
Definition player_sao.h:93
float getZoomFOV() const
Definition player_sao.cpp:765
v3s16 m_nocheat_dig_pos
Definition player_sao.h:191
u16 getWieldIndex() const override
Definition player_sao.cpp:574
std::string getWieldList() const override
Definition player_sao.h:120
void noCheatDigEnd()
Definition player_sao.h:151
void unlinkPlayerSessionAndSave()
Definition player_sao.cpp:606
bool m_position_not_sent
Definition player_sao.h:201
float m_time_from_last_teleport
Definition player_sao.h:189
void setPos(const v3f &pos) override
Definition player_sao.cpp:348
void moveTo(v3f pos, bool continuous) override
Definition player_sao.cpp:389
IntervalLimiter m_drowning_interval
Definition player_sao.h:198
s16 m_wanted_range
Definition player_sao.h:210
void noCheatDigStart(const v3s16 &p)
Definition player_sao.h:144
void setBreath(const u16 breath, bool send=true)
Definition player_sao.cpp:536
std::set< std::string > m_privs
Definition player_sao.h:204
void setInventoryModified() override
Definition player_sao.h:119
LagPool & getDigPool()
Definition player_sao.h:152
void step(float dtime, bool send_recommended) override
Definition player_sao.cpp:142
bool m_camera_inverted
Definition player_sao.h:212
InventoryLocation getInventoryLocation() const override
Definition player_sao.cpp:567
SimpleMetadata m_meta
Definition player_sao.h:214
bool m_physics_override_sent
Definition player_sao.h:223
IntervalLimiter m_node_hurt_interval
Definition player_sao.h:199
v3f getLastGoodPosition() const
Definition player_sao.h:137
IntervalLimiter m_breathing_interval
Definition player_sao.h:197
void setLookPitchAndSend(const float pitch)
Definition player_sao.cpp:442
LagPool m_dig_pool
Definition player_sao.h:186
bool node_damage
Definition player_sao.h:220
void setPlayerYaw(const float yaw)
Definition player_sao.cpp:402
bool getCameraInverted() const
Definition player_sao.h:95
v3f m_last_good_position
Definition player_sao.h:188
float m_nocheat_dig_time
Definition player_sao.h:192
u16 m_breath
Definition player_sao.h:207
u16 getBreath() const
Definition player_sao.h:110
f32 getFov() const
Definition player_sao.h:91
float m_time_from_last_punch
Definition player_sao.h:190
PlayerSAO(ServerEnvironment *env_, RemotePlayer *player_, session_t peer_id_, bool is_singleplayer)
Definition player_sao.cpp:13
u32 punch(v3f dir, const ToolCapabilities *toolcap, ServerActiveObject *puncher, float time_from_last_punch, u16 initial_wear=0) override
Definition player_sao.cpp:448
void finalize(RemotePlayer *player, const std::set< std::string > &privs)
Definition player_sao.cpp:53
bool checkMovementCheat()
Definition player_sao.cpp:632
v3f getEyeOffset() const
Definition player_sao.cpp:60
f32 getLookPitch() const
Definition player_sao.h:86
void setCameraInverted(bool camera_inverted)
Definition player_sao.h:94
std::string getPropertyPacket()
Definition player_sao.cpp:613
f32 getRadLookPitch() const
Definition player_sao.h:87
void setHP(s32 hp, const PlayerHPChangeReason &reason) override
Definition player_sao.h:104
void setMaxSpeedOverride(const v3f &vel)
Definition player_sao.cpp:619
void setFov(const float pitch)
Definition player_sao.cpp:412
void respawn()
Definition player_sao.cpp:547
f32 m_pitch
Definition player_sao.h:208
Inventory * getInventory() const override
Definition player_sao.cpp:562
RemotePlayer * m_player
Definition player_sao.h:182
float m_max_speed_override_time
Definition player_sao.h:193
session_t getPeerID() const
Definition player_sao.cpp:600
std::string getDescription() override
Definition player_sao.cpp:65
ItemStack getWieldedItem(ItemStack *selected, ItemStack *hand=nullptr) const override
Definition player_sao.cpp:579
bool getSelectionBox(aabb3f *toset) const override
Definition player_sao.cpp:753
void getStaticData(std::string *result) const override
Definition player_sao.cpp:137
bool setWieldedItem(const ItemStack &item) override
Definition player_sao.cpp:584
float resetTimeFromLastPunch()
Definition player_sao.h:138
SimpleMetadata & getMeta()
Definition player_sao.h:175
void setWantedRange(const s16 range)
Definition player_sao.cpp:420
void setHPRaw(u16 hp)
Definition player_sao.h:109
f32 getRadLookPitchDep() const
Definition player_sao.h:89
ActiveObjectType getSendType() const override
Definition player_sao.h:62
float getNoCheatDigTime()
Definition player_sao.h:150
v3s16 getNoCheatDigPos()
Definition player_sao.h:149
v3f getEyePosition() const
Definition player_sao.h:171
RemotePlayer * getPlayer()
Definition player_sao.h:132
bool getCollisionBox(aabb3f *toset) const override
Definition player_sao.cpp:742
bool isStaticAllowed() const override
Definition player_sao.h:71
v3f m_max_speed_override
Definition player_sao.h:194
void setLookPitch(const float pitch)
Definition player_sao.cpp:434
void setPlayer(RemotePlayer *player)
Definition player_sao.h:131
bool shouldUnload() const override
Definition player_sao.h:72
void addPos(const v3f &added_pos) override
Definition player_sao.cpp:365
bool collideWithObjects() const override
Definition player_sao.h:167
f32 m_fov
Definition player_sao.h:209
ActiveObjectType getType() const override
Definition player_sao.h:61
void removingFromEnvironment() override
Definition player_sao.cpp:82
void addedToEnvironment(u32 dtime_s) override
Definition player_sao.cpp:71
session_t m_peer_id_initial
only used to initialize RemotePlayer
Definition player_sao.h:183
LagPool m_move_pool
Definition player_sao.h:187
void updatePrivileges(const std::set< std::string > &privs, bool is_singleplayer)
Definition player_sao.h:159
bool m_is_singleplayer
Definition player_sao.h:205
bool breathing
Definition player_sao.h:218
struct PlayerSAO::@29 m_flags
Definition remoteplayer.h:26
Definition serveractiveobject.h:41
v3f m_base_position
Definition serveractiveobject.h:248
Definition serverenvironment.h:219
u16 m_hp
Definition unit_sao.h:96
#define PLAYER_MAX_BREATH_DEFAULT
Definition constants.h:83
core::aabbox3d< f32 > aabb3f
Definition irr_aabb3d.h:11
core::vector3d< s16 > v3s16
Definition irr_v3d.h:13
core::vector3df v3f
Definition irr_v3d.h:11
u16 session_t
Definition networkprotocol.h:22
Definition inventorymanager.h:18
Definition inventory.h:19
Definition player_sao.h:227
PlayerHPChangeReason(Type type, ServerActiveObject *object)
Definition player_sao.h:294
ServerActiveObject * object
Definition player_sao.h:244
Type
Definition player_sao.h:229
@ RESPAWN
Definition player_sao.h:236
@ DROWNING
Definition player_sao.h:235
@ FALL
Definition player_sao.h:233
@ SET_HP
Definition player_sao.h:230
@ SET_HP_MAX
Definition player_sao.h:231
@ PLAYER_PUNCH
Definition player_sao.h:232
@ NODE_DAMAGE
Definition player_sao.h:234
bool from_mod
Definition player_sao.h:240
PlayerHPChangeReason(Type type, std::string node, v3s16 node_pos)
Definition player_sao.h:299
std::string getTypeAsString() const
Definition player_sao.h:271
bool setTypeFromString(const std::string &typestr)
Definition player_sao.h:251
std::string node
Definition player_sao.h:246
int lua_reference
Definition player_sao.h:241
PlayerHPChangeReason(Type type)
Definition player_sao.h:292
bool hasLuaReference() const
Definition player_sao.h:249
Type type
Definition player_sao.h:239
v3s16 node_pos
Definition player_sao.h:247
static std::string p(std::string path)
Definition test_filesys.cpp:53