/*! * @file network_monitor.h * a class to monitor the network: throughput, network nodes */ #ifndef _NETWORK_MONITOR_H #define _NETWORK_MONITOR_H #include "base_object.h" #include "synchronizeable.h" #include "network_node.h" #include class NetworkStream; class PeerInfo; namespace OrxGui { class GLGuiBox; }; //!< a class that monitors the whole network. it tries to gather all informations its able to from the network class NetworkMonitor : public Synchronizeable { public: NetworkMonitor(NetworkStream* networkStream); virtual ~NetworkMonitor(); /* client/masterserver/proxyserver addition/removal interface */ void addNetworkNode(NetworkNode* node); void removeNetworkNode(NetworkNode* node); inline void addClient(NetworkNode* node, PeerInfo* pInfo) { node->addClient(pInfo); } inline void addProxyServer(NetworkNode* node, PeerInfo* pInfo) { node->addProxyServer(pInfo); } inline void addMasterServer(NetworkNode* node, PeerInfo* pInfo) { node->addMasterServer(pInfo); } inline void removeClient(NetworkNode* node, PeerInfo* pInfo) { node->removeClient(pInfo); } inline void removeProxyServer(NetworkNode* node, PeerInfo* pInfo) { node->removeProxyServer(pInfo); } inline void removeMasterServer(NetworkNode* node, PeerInfo* pInfo) { node->removeMasterServer(pInfo); } void showGUI(); void hideGUI(); void process(); private: NetworkStream* networkStream; //!< reference to the one networkstream of the network std::list nodeList; //!< list of all network nodes OrxGui::GLGuiBox* box; int playerNumber; //!< total number of players in the game }; #endif