diff --git a/src/client/client.cpp b/src/client/client.cpp index d07a8eb4a..9c12be8f2 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -436,6 +436,8 @@ void Client::step(float dtime) } } + // The issue that made this workaround necessary was fixed in August 2024, but + // it's not like we can remove this code - ever. if (m_state == LC_Created) { float &counter = m_connection_reinit_timer; counter -= dtime; diff --git a/src/network/peerhandler.h b/src/network/peerhandler.h index 1e00249ca..64e2c85fb 100644 --- a/src/network/peerhandler.h +++ b/src/network/peerhandler.h @@ -30,9 +30,10 @@ class PeerHandler { public: PeerHandler() = default; - virtual ~PeerHandler() = default; + // Note: all functions are called from within a Receive() call on the same thread. + /* This is called after the Peer has been inserted into the Connection's peer container. @@ -46,22 +47,4 @@ public: virtual void deletingPeer(IPeer *peer, bool timeout) = 0; }; -enum PeerChangeType : u8 -{ - PEER_ADDED, - PEER_REMOVED -}; - -struct PeerChange -{ - PeerChange(PeerChangeType t, session_t _peer_id, bool _timeout) : - type(t), peer_id(_peer_id), timeout(_timeout) - { - } - PeerChange() = delete; - - PeerChangeType type; - session_t peer_id; - bool timeout; -}; } diff --git a/src/server.cpp b/src/server.cpp index fe831d0f7..609b7188b 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -623,8 +623,6 @@ void Server::AsyncRunStep(float dtime, bool initial_step) */ m_uptime_counter->increment(dtime); - handlePeerChanges(); - /* Update time of day and overall game time */ @@ -1257,19 +1255,18 @@ void Server::onMapEditEvent(const MapEditEvent &event) void Server::peerAdded(con::IPeer *peer) { - verbosestream<<"Server::peerAdded(): peer->id=" - <id<id=" - <id<<", timeout="< m_peer_change_queue; - std::unordered_map m_formspec_state_data; /*