Changeset 9481 in orxonox.OLD
- Timestamp:
- Jul 26, 2006, 10:12:26 AM (18 years ago)
- Location:
- branches/proxy/src/lib/network
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/network/network_manager.cc
r9478 r9481 146 146 147 147 // start the network game manager 148 //this->networkStream->createNetworkGameManager();148 this->networkStream->createNetworkGameManager(); 149 149 150 150 -
branches/proxy/src/lib/network/network_stream.cc
r9479 r9481 367 367 368 368 /** 369 * if we are a NET_MASTER_SERVER or NET_PROXY_SERVER_ACTIVE update the connection list to accept new 370 * connections (clients) also start the handsake for the new clients 369 * @brief handles incoming connections 370 * 371 * if we are a NET_MASTER_SERVER or NET_PROXY_SERVER_ACTIVE update the connection list to accept new connections (clients) 372 * start and initialize the handsake for the new clients 371 373 */ 372 374 void NetworkStream::updateConnectionList( ) … … 401 403 peers[userId].socket = tempNetworkSocket; 402 404 peers[userId].nodeType = NET_CLIENT; 405 406 // handle the newly connected client 403 407 this->handleConnect(userId); 404 408 … … 433 437 peers[userId].socket = tempNetworkSocket; 434 438 peers[userId].nodeType = NET_PROXY_SERVER_ACTIVE; 439 440 // handle the newly connected proxy server 435 441 this->handleConnect(userId); 436 442 437 PRINTF(0)("New Proxy: %d\n", userId);443 PRINTF(0)("New proxy connected: %d\n", userId); 438 444 } 439 445 } … … 469 475 470 476 477 /** 478 * this handles new connections 479 * @param userId: the id of the new user node 480 */ 471 481 void NetworkStream::handleConnect( int userId) 472 482 { … … 480 490 PRINTF(0)("num sync: %d\n", synchronizeables.size()); 481 491 482 492 // get the proxy server informations and write them to the handshake, if any (proxy) 483 493 assert( this->networkMonitor != NULL); 484 494 PeerInfo* pi = this->networkMonitor->getFirstChoiceProxy(); … … 491 501 peers[userId].handshake->setProxy2Address( pi->ip); 492 502 493 503 // check if the connecting client should reconnect to a proxy server 494 504 peers[userId].handshake->setRedirect(this->networkMonitor->isReconnectNextClient()); 495 505 496 506 // the connecting node of course is a client 497 507 peers[userId].ip = peers[userId].socket->getRemoteAddress(); 498 508 } 499 509 500 510 511 512 /** 513 * some debug output 514 */ 501 515 void NetworkStream::debug() 502 516 { … … 564 578 if( SharedNetworkData::getInstance()->isClient() || SharedNetworkData::getInstance()->isProxyServerActive() && it->second.isMasterServer()) 565 579 { 580 PRINTF(0)("Handshake: i am in client role\n"); 581 566 582 SharedNetworkData::getInstance()->setHostID( it->second.handshake->getHostId() ); 567 583 this->pInfo->userId = SharedNetworkData::getInstance()->getHostID(); … … 569 585 it->second.ip = it->second.socket->getRemoteAddress(); 570 586 571 //it->second.nodeType = it->second.handshake->getRemoteNodeType();572 //it->second.ip = it->second.socket->getRemoteAddress();587 // it->second.nodeType = it->second.handshake->getRemoteNodeType(); 588 // it->second.ip = it->second.socket->getRemoteAddress(); 573 589 // add the new server to the nodes list (it can be a NET_MASTER_SERVER or NET_PROXY_SERVER) 574 590 this->networkMonitor->addNode(&it->second); … … 616 632 else if ( SharedNetworkData::getInstance()->isProxyServerActive() && it->second.isClient() ) 617 633 { 634 PRINTF(0)("Handshake: i am in server role\n"); 635 618 636 it->second.ip = it->second.socket->getRemoteAddress(); 619 637
Note: See TracChangeset
for help on using the changeset viewer.