- Timestamp:
- Jul 14, 2006, 11:18:17 AM (18 years ago)
- Location:
- branches/proxy/src/lib/network
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/network/monitor/network_monitor.cc
r9286 r9287 40 40 this->networkStream = networkStream; 41 41 this->playerNumber = 0; 42 // create the localnode, init it and add it to the nodes list 42 43 this->localNode = new NetworkNode( this->networkStream->getPeerInfo()); 44 this->addNode(this->localNode); 43 45 44 46 this->setSynchronized(false); … … 101 103 this->localNode->addMasterServer(pInfo); 102 104 } 105 106 107 /** 108 * adds a network node to the local node 109 * @param node node to add to 110 * @param pInfo node information 111 */ 112 void NetworkMonitor::addNode(NetworkNode* node, PeerInfo* pInfo) 113 { 114 if( node == NULL) 115 return; 116 117 if( pInfo->isClient()) 118 node->addClient(pInfo); 119 else if( pInfo->isProxyServer()) 120 node->addProxyServer(pInfo); 121 else if( pInfo->isMasterServer()) 122 node->addMasterServer(pInfo); 123 } 124 103 125 104 126 /** … … 166 188 PRINTF(0)("================================= Network Monitor ========\n"); 167 189 PRINTF(0)(" I am: %s\n", this->localNode->getPeerInfo()->getNodeTypeString().c_str()); 168 PRINTF(0)(" Total count of network nodes: %i\n", this->playerNumber); 190 PRINTF(0)(" Total count of network connections: %i\n", this->playerNumber); 191 192 std::list<NetworkNode*>::iterator it = this->nodeList.begin(); 193 for(; it != this->nodeList.end(); it++) 194 { 195 (*it)->debug(); 196 } 197 169 198 PRINTF(0)("==========================================================\n"); 170 199 // PRINTF(0)(" Currently got %i"); -
branches/proxy/src/lib/network/monitor/network_monitor.h
r9285 r9287 35 35 36 36 void addNode(PeerInfo* pInfo); 37 void addNode(NetworkNode* node, PeerInfo* pInfo) {} 37 void addNode(NetworkNode* node) { this->nodeList.push_back(node); } 38 void addNode(NetworkNode* node, PeerInfo* pInfo); 38 39 39 40 /** adds to @param node a network node @param pInfo a new client */ -
branches/proxy/src/lib/network/network_stream.cc
r9286 r9287 235 235 if( this->networkMonitor == NULL) 236 236 this->networkMonitor = new NetworkMonitor(this); 237 // and let it process some data238 this->networkMonitor->process();239 237 240 238 … … 485 483 { 486 484 it->second.nodeType = it->second.handshake->getRemoteNodeType(); 485 this->networkMonitor->addNode(&it->second); 487 486 488 487 handleNewClient( it->second.userId );
Note: See TracChangeset
for help on using the changeset viewer.