mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-12 16:15:20 +02:00
RemotePlayer: make peer ID always reflect the validity of PlayerSAO (#14317)
Upon disconnect, RemotePlayer still had a peer ID assigned even though the PlayerSAO object was maked as gone (for removal). This commit makes that the following always holds true: (!sao || sao->isGone()) === (peer_id == PEER_ID_INEXISTENT)
This commit is contained in:
@@ -142,8 +142,9 @@ public:
|
||||
|
||||
void disconnected();
|
||||
|
||||
void setPlayer(RemotePlayer *player) { m_player = player; }
|
||||
RemotePlayer *getPlayer() { return m_player; }
|
||||
session_t getPeerID() const { return m_peer_id; }
|
||||
session_t getPeerID() const;
|
||||
|
||||
// Cheat prevention
|
||||
|
||||
@@ -193,7 +194,7 @@ private:
|
||||
std::string generateUpdatePhysicsOverrideCommand() const;
|
||||
|
||||
RemotePlayer *m_player = nullptr;
|
||||
session_t m_peer_id = 0;
|
||||
session_t m_peer_id_initial = 0; ///< only used to initialize RemotePlayer
|
||||
|
||||
// Cheat prevention
|
||||
LagPool m_dig_pool;
|
||||
|
Reference in New Issue
Block a user