1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00: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:
SmallJoker 2024-02-02 22:13:24 +01:00 committed by GitHub
parent 893594d81a
commit e7dbd325d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 86 additions and 61 deletions

View file

@ -352,6 +352,8 @@ public:
void DenySudoAccess(session_t peer_id);
void DenyAccess(session_t peer_id, AccessDeniedCode reason,
const std::string &custom_reason = "", bool reconnect = false);
void kickAllPlayers(AccessDeniedCode reason,
const std::string &str_reason, bool reconnect);
void acceptAuth(session_t peer_id, bool forSudoMode);
void DisconnectPeer(session_t peer_id);
bool getClientConInfo(session_t peer_id, con::rtt_stat_type type, float *retval);
@ -363,8 +365,8 @@ public:
void HandlePlayerHPChange(PlayerSAO *sao, const PlayerHPChangeReason &reason);
void SendPlayerHP(PlayerSAO *sao, bool effect);
void SendPlayerBreath(PlayerSAO *sao);
void SendInventory(PlayerSAO *playerSAO, bool incremental);
void SendMovePlayer(session_t peer_id);
void SendInventory(RemotePlayer *player, bool incremental);
void SendMovePlayer(PlayerSAO *sao);
void SendMovePlayerRel(session_t peer_id, const v3f &added_pos);
void SendPlayerSpeed(session_t peer_id, const v3f &added_vel);
void SendPlayerFov(session_t peer_id);