Changeset 9625 in orxonox.OLD for branches/proxy/src/lib/network/monitor/network_monitor.cc
- Timestamp:
- Jul 30, 2006, 11:19:24 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/network/monitor/network_monitor.cc
r9589 r9625 10 10 11 11 ### File Specific: 12 main-programmer: Patrick Boenzli 12 main-programmer: Patrick Boenzli (patrick@orxonox.ethz.ch) 13 13 */ 14 14 … … 49 49 this->networkStream = networkStream; 50 50 this->playerNumber = 0; 51 this->connectionNumber = 0; 51 52 // create the localnode, init it and add it to the nodes list 52 53 this->localNode = new NetworkNode( this->networkStream->getPeerInfo()); … … 69 70 peer->userId = -1; 70 71 71 NetworkNode* node = new NetworkNode(peer);72 this->addNode( node);73 72 this->addActiveProxyServer( this->localNode, peer); 74 73 } … … 141 140 return; 142 141 142 PRINTF(0)("^^^^^^^^^^^^^^^^^^^^^^^^^^ adding node: %i with type: %s\n\n", pInfo->userId, pInfo->getNodeTypeString().c_str()); 143 143 144 if( pInfo->isClient()) 144 this->localNode->addClient(pInfo); 145 { 146 this->localNode->addClient(new NetworkNode(pInfo)); 147 } 145 148 else if( pInfo->isProxyServerActive()) 146 149 { 147 this->localNode->addActiveProxyServer(pInfo); 148 // create a new node, since a proxy can connect clients again 149 NetworkNode* node = new NetworkNode(pInfo); 150 this->nodeList.push_back(node); 150 this->localNode->addActiveProxyServer(new NetworkNode(pInfo)); 151 } 152 else if( pInfo->isProxyServerActivePassive()) 153 { 154 this->localNode->addPassiveProxyServer(new NetworkNode(pInfo)); 151 155 } 152 156 else if( pInfo->isMasterServer()) 153 157 { 154 this->localNode->addMasterServer(pInfo); 155 } 158 this->localNode->addMasterServer(new NetworkNode(pInfo)); 159 } 160 else 161 assert(false); 156 162 } 157 163 … … 168 174 169 175 if( pInfo->isClient()) 170 node->addClient( pInfo);176 node->addClient(new NetworkNode(pInfo)); 171 177 else if( pInfo->isProxyServerActive()) 172 node->addActiveProxyServer( pInfo);178 node->addActiveProxyServer(new NetworkNode(pInfo)); 173 179 else if( pInfo->isMasterServer()) 174 node->addMasterServer( pInfo);180 node->addMasterServer(new NetworkNode(pInfo)); 175 181 } 176 182 … … 198 204 199 205 if( pInfo->isClient()) 200 node->removeClient(pInfo );206 node->removeClient(pInfo->userId); 201 207 else if( pInfo->isProxyServerActive()) 202 node->removeActiveProxyServer(pInfo );208 node->removeActiveProxyServer(pInfo->userId); 203 209 else if( pInfo->isMasterServer()) 204 node->removeMasterServer(pInfo );210 node->removeMasterServer(pInfo->userId); 205 211 } 206 212 … … 253 259 for(; it != this->nodeList.end(); it++) 254 260 { 261 PRINTF(0)("comparing %i to %i\n", (*it)->getPeerInfo()->userId, userId); 255 262 if( (*it)->getPeerInfo()->userId == userId) 256 263 return (*it); … … 308 315 for(; it != this->nodeList.end(); it++) 309 316 { 310 (*it)->debug( 0);317 (*it)->debug(1); 311 318 } 312 319
Note: See TracChangeset
for help on using the changeset viewer.