1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Apply review.

This commit is contained in:
SFENCE 2025-06-09 19:17:51 +02:00
parent 0b423bdb22
commit 07bbe4f454
2 changed files with 6 additions and 3 deletions

View file

@ -14,7 +14,6 @@ PlayerSAO::PlayerSAO(ServerEnvironment *env_, RemotePlayer *player_, session_t p
bool is_singleplayer): bool is_singleplayer):
UnitSAO(env_, v3f(0,0,0)), UnitSAO(env_, v3f(0,0,0)),
m_player(player_), m_player(player_),
m_player_name(player_->getName()),
m_peer_id_initial(peer_id_), m_peer_id_initial(peer_id_),
m_is_singleplayer(is_singleplayer) m_is_singleplayer(is_singleplayer)
{ {
@ -408,6 +407,11 @@ void PlayerSAO::setPlayerYaw(const float yaw)
UnitSAO::setRotation(rotation); UnitSAO::setRotation(rotation);
} }
std::string PlayerSAO::getGUID()
{
return m_player->getName();
}
void PlayerSAO::setFov(const float fov) void PlayerSAO::setFov(const float fov)
{ {
if (m_player && fov != m_fov) if (m_player && fov != m_fov)

View file

@ -78,7 +78,7 @@ public:
void addPos(const v3f &added_pos) override; void addPos(const v3f &added_pos) override;
void moveTo(v3f pos, bool continuous) override; void moveTo(v3f pos, bool continuous) override;
void setPlayerYaw(const float yaw); void setPlayerYaw(const float yaw);
std::string getGUID() override { return m_player_name; } std::string getGUID() override;
// Data should not be sent at player initialization // Data should not be sent at player initialization
void setPlayerYawAndSend(const float yaw); void setPlayerYawAndSend(const float yaw);
void setLookPitch(const float pitch); void setLookPitch(const float pitch);
@ -183,7 +183,6 @@ private:
std::string generateUpdatePhysicsOverrideCommand() const; std::string generateUpdatePhysicsOverrideCommand() const;
RemotePlayer *m_player = nullptr; RemotePlayer *m_player = nullptr;
std::string m_player_name; ///< used as GUID
session_t m_peer_id_initial = 0; ///< only used to initialize RemotePlayer session_t m_peer_id_initial = 0; ///< only used to initialize RemotePlayer
// Cheat prevention // Cheat prevention