From a26c92d7dda327f2b1483fe7250cb27580a0a039 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Fri, 24 Dec 2010 17:08:50 +0200 Subject: disconnect method to connection to be used instead of just timing out --- src/server.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/server.h') diff --git a/src/server.h b/src/server.h index f1baaf240..cd6f78c62 100644 --- a/src/server.h +++ b/src/server.h @@ -434,6 +434,11 @@ private: void UpdateBlockWaterPressure(MapBlock *block, core::map &modified_blocks); + // Locks environment and connection by its own + struct PeerChange; + void handlePeerChange(PeerChange &c); + void handlePeerChanges(); + float m_flowwater_timer; float m_print_info_timer; float m_objectdata_timer; @@ -466,6 +471,23 @@ private: float m_time_counter; float m_time_of_day_send_timer; + MutexedVariable m_uptime; + + enum PeerChangeType + { + PEER_ADDED, + PEER_REMOVED + }; + + struct PeerChange + { + PeerChangeType type; + u16 peer_id; + bool timeout; + }; + + Queue m_peer_change_queue; + friend class EmergeThread; friend class RemoteClient; }; -- cgit v1.2.3