Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/proxy/src/lib/network/monitor/network_monitor.h @ 9279

Last change on this file since 9279 was 9279, checked in by patrick, 18 years ago

number of players calculus

File size: 1.7 KB
Line 
1/*!
2 * @file network_monitor.h
3 *  a class to monitor the network: throughput, network nodes
4 */
5
6#ifndef _NETWORK_MONITOR_H
7#define _NETWORK_MONITOR_H
8
9#include "base_object.h"
10#include "synchronizeable.h"
11
12#include "network_node.h"
13
14#include <list>
15
16class NetworkStream;
17class PeerInfo;
18
19
20namespace OrxGui { class GLGuiBox; };
21
22
23
24//!< a class that monitors the whole network. it tries to gather all informations its able to from the network
25class NetworkMonitor : public Synchronizeable
26{
27
28  public:
29    NetworkMonitor(NetworkStream* networkStream);
30    virtual ~NetworkMonitor();
31
32    /* client/masterserver/proxyserver addition/removal interface */
33    void addNetworkNode(NetworkNode* node);
34    void removeNetworkNode(NetworkNode* node);
35
36    inline void addClient(NetworkNode* node, PeerInfo* pInfo) { node->addClient(pInfo); }
37    inline void addProxyServer(NetworkNode* node, PeerInfo* pInfo) { node->addProxyServer(pInfo); }
38    inline void addMasterServer(NetworkNode* node, PeerInfo* pInfo) { node->addMasterServer(pInfo); }
39
40    inline void removeClient(NetworkNode* node, PeerInfo* pInfo) { node->removeClient(pInfo); }
41    inline void removeProxyServer(NetworkNode* node, PeerInfo* pInfo) { node->removeProxyServer(pInfo); }
42    inline void removeMasterServer(NetworkNode* node, PeerInfo* pInfo) { node->removeMasterServer(pInfo); }
43
44
45    void showGUI();
46    void hideGUI();
47
48    void process();
49
50
51  private:
52    NetworkStream*               networkStream;              //!< reference to the one networkstream of the network
53    std::list<NetworkNode*>      nodeList;                   //!< list of all network nodes
54
55    OrxGui::GLGuiBox*            box;
56
57    int                          playerNumber;                 //!< total number of players in the game
58};
59
60
61#endif
Note: See TracBrowser for help on using the repository browser.