diff options
Diffstat (limited to 'src/network/connection.h')
-rw-r--r-- | src/network/connection.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/network/connection.h b/src/network/connection.h index 47b0805ce..24cd4fe4a 100644 --- a/src/network/connection.h +++ b/src/network/connection.h @@ -30,7 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "networkprotocol.h" #include <iostream> #include <fstream> -#include <list> +#include <vector> #include <map> class NetworkPacket; @@ -795,7 +795,7 @@ protected: void PrintInfo(std::ostream &out); - std::list<session_t> getPeerIDs() + std::vector<session_t> getPeerIDs() { MutexAutoLock peerlock(m_peers_mutex); return m_peer_ids; @@ -809,6 +809,11 @@ protected: void putEvent(ConnectionEvent &e); void TriggerSend(); + + bool ConnectedToServer() + { + return getPeerNoEx(PEER_ID_SERVER) != nullptr; + } private: MutexedQueue<ConnectionEvent> m_event_queue; @@ -816,7 +821,7 @@ private: u32 m_protocol_id; std::map<session_t, Peer *> m_peers; - std::list<session_t> m_peer_ids; + std::vector<session_t> m_peer_ids; std::mutex m_peers_mutex; std::unique_ptr<ConnectionSendThread> m_sendThread; |