Changeset 9308 in orxonox.OLD for branches/proxy/src/lib/network/monitor
- Timestamp:
- Jul 17, 2006, 5:47:32 PM (19 years ago)
- Location:
- branches/proxy/src/lib/network/monitor
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/network/monitor/network_monitor.cc
r9303 r9308 20 20 21 21 #include "proxy/proxy_settings.h" 22 #include "shared_network_data.h" 22 23 23 24 #include "network_monitor.h" … … 52 53 this->setSynchronized(false); 53 54 54 // assuming that the config files are already read we get the proxy servers 55 std::vector<IPaddress*>* proxyList = ProxySettings::getInstance()->getProxyList(); 56 std::vector<IPaddress*>::iterator it = proxyList->begin(); 57 // create a peer info class and a network node class for each new proxy and add them to the passive list 58 for(; it < proxyList->end(); it++) 59 { 60 PeerInfo* peer = new PeerInfo(); 61 peer->ip = *(*it); 62 peer->nodeType = NET_PROXY_SERVER_ACTIVE; 63 peer->userId = -1; 64 65 NetworkNode* node = new NetworkNode(peer); 66 this->addPassiveProxyServer( this->localNode, peer); 55 // read in the proxy server list, this is only the case for the master server 56 if( SharedNetworkData::getInstance()->isMasterServer()) 57 { 58 // assuming that the config files are already read we get the proxy servers 59 std::vector<IPaddress*>* proxyList = ProxySettings::getInstance()->getProxyList(); 60 std::vector<IPaddress*>::iterator it = proxyList->begin(); 61 // create a peer info class and a network node class for each new proxy and add them to the passive list 62 for(; it < proxyList->end(); it++) 63 { 64 PeerInfo* peer = new PeerInfo(); 65 peer->ip = *(*it); 66 peer->nodeType = NET_PROXY_SERVER_ACTIVE; 67 peer->userId = -1; 68 69 NetworkNode* node = new NetworkNode(peer); 70 this->addNode( node); 71 this->addPassiveProxyServer( this->localNode, peer); 72 } 67 73 } 68 74 } … … 111 117 * @param ip ip of the new node 112 118 */ 113 void NetworkMonitor::addNode(IPaddress ip) 114 {} 119 void NetworkMonitor::addNode(IPaddress ip, int nodeType) 120 { 121 PeerInfo* pInfo = new PeerInfo(); 122 pInfo->nodeType = nodeType; 123 pInfo->ip = ip; 124 125 this->addNode( pInfo); 126 } 115 127 116 128 -
branches/proxy/src/lib/network/monitor/network_monitor.h
r9300 r9308 34 34 void removeNetworkNode(NetworkNode* node); 35 35 36 void addNode(IPaddress ip);37 36 void addNode(PeerInfo* pInfo); 37 void addNode(IPaddress ip, int nodeType); 38 38 void addNode(NetworkNode* node) { this->nodeList.push_back(node); } 39 39 void addNode(NetworkNode* node, PeerInfo* pInfo); -
branches/proxy/src/lib/network/monitor/network_node.cc
r9300 r9308 239 239 for(; it != this->masterServerList.end(); it++) 240 240 { 241 PRINT(0)(" - ms, id: %i\n", (*it)->userId); 242 } 243 244 PRINT(0)(" proxy servers: %i\n", this->activeProxyServerList.size()); 241 int ip = (*it)->ip.host; 242 PRINT(0)(" - ms, id: %i (%d.%d.%d.%d:9999)\n", (*it)->userId, (ip & 0x000000FF), (ip & 0x0000FF00) >> 8, (ip & 0x00FF0000) >> 16, (ip & 0xFF000000)>>24); 243 } 244 245 PRINT(0)(" proxy servers active: %i\n", this->activeProxyServerList.size()); 245 246 it = this->activeProxyServerList.begin(); 246 247 for(; it != this->activeProxyServerList.end(); it++) 247 248 { 248 PRINT(0)(" - ps, id: %i\n", (*it)->userId); 249 int ip = (*it)->ip.host; 250 PRINT(0)(" - ps-a, id: %i (%d.%d.%d.%d:9999)\n", (*it)->userId, (ip & 0x000000FF), (ip & 0x0000FF00) >> 8, (ip & 0x00FF0000) >> 16, (ip & 0xFF000000)>>24); 251 } 252 253 PRINT(0)(" proxy servers passive: %i\n", this->passiveProxyServerList.size()); 254 it = this->passiveProxyServerList.begin(); 255 for(; it != this->passiveProxyServerList.end(); it++) 256 { 257 int ip = (*it)->ip.host; 258 PRINT(0)(" - ps-p, id: %i (%d.%d.%d.%d:9999)\n", (*it)->userId, (ip & 0x000000FF), (ip & 0x0000FF00) >> 8, (ip & 0x00FF0000) >> 16, (ip & 0xFF000000)>>24); 249 259 } 250 260 … … 253 263 for(; it != this->clientList.end(); it++) 254 264 { 255 PRINT(0)(" - client, id: %i\n", (*it)->userId); 256 } 257 } 258 265 int ip = (*it)->ip.host; 266 PRINT(0)(" - client, id: %i (%d.%d.%d.%d:9999)\n", (*it)->userId, (ip & 0x000000FF), (ip & 0x0000FF00) >> 8, (ip & 0x00FF0000) >> 16, (ip & 0xFF000000)>>24); 267 } 268 } 269
Note: See TracChangeset
for help on using the changeset viewer.