Changeset 9425 in orxonox.OLD for branches/proxy
- Timestamp:
- Jul 24, 2006, 2:48:23 PM (18 years ago)
- Location:
- branches/proxy/src/lib/network
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/network/network_manager.cc
r9422 r9425 137 137 138 138 139 140 139 // start the network game manager 141 140 this->networkStream->createNetworkGameManager(); -
branches/proxy/src/lib/network/network_stream.cc
r9422 r9425 201 201 { 202 202 int node = this->peers.size(); 203 PRINTF(0)("connect to proxy %s, this is node %i\n", host.c_str(), node); 204 203 205 this->peers[node].socket = new UdpSocket( host, port ); 204 206 this->peers[node].userId = 0; … … 517 519 if ( !it->second.handshake->allowDel() ) 518 520 { 519 520 if ( this->pInfo->isClient() ) 521 // make sure this is a client 522 assert( this->pInfo->isClient()); 523 524 SharedNetworkData::getInstance()->setHostID( it->second.handshake->getHostId() ); 525 this->pInfo->userId = SharedNetworkData::getInstance()->getHostID(); 526 527 it->second.nodeType = it->second.handshake->getRemoteNodeType(); 528 it->second.ip = it->second.socket->getRemoteAddress(); 529 // add the new server to the nodes list (it can be a NET_MASTER_SERVER or NET_PROXY_SERVER) 530 this->networkMonitor->addNode(&it->second); 531 // get proxy 1 address and add it 532 this->networkMonitor->addNode(it->second.handshake->getProxy1Address(), NET_PROXY_SERVER_ACTIVE); 533 // get proxy 2 address and add it 534 this->networkMonitor->addNode(it->second.handshake->getProxy2Address(), NET_PROXY_SERVER_ACTIVE); 535 536 // now check if the server accepted the connection 537 if( !it->second.handshake->redirect()) 521 538 { 522 SharedNetworkData::getInstance()->setHostID( it->second.handshake->getHostId() );523 this->pInfo->userId = SharedNetworkData::getInstance()->getHostID();524 525 it->second.nodeType = it->second.handshake->getRemoteNodeType();526 it->second.ip = it->second.socket->getRemoteAddress();527 // add the new server to the nodes list (it can be a NET_MASTER_SERVER or NET_PROXY_SERVER)528 this->networkMonitor->addNode(&it->second);529 // get proxy 1 address and add it530 this->networkMonitor->addNode(it->second.handshake->getProxy1Address(), NET_PROXY_SERVER_ACTIVE);531 // get proxy 2 address and add it532 this->networkMonitor->addNode(it->second.handshake->getProxy2Address(), NET_PROXY_SERVER_ACTIVE);533 534 // now check if the server accepted the connection535 if( !it->second.handshake->redirect())536 {537 539 // create the new network game manager and init it 538 539 540 this->networkGameManager = NetworkGameManager::getInstance(); 541 this->networkGameManager->setUniqueID( it->second.handshake->getNetworkGameManagerId() ); 540 542 // init the new message manager 541 MessageManager::getInstance()->setUniqueID( it->second.handshake->getMessageManagerId() ); 542 543 PRINT(0)("handshake finished id=%d\n", it->second.handshake->getNetworkGameManagerId()); 544 it->second.handshake->del(); 545 } 546 else 547 this->handleReconnect( it->second.userId); 548 543 MessageManager::getInstance()->setUniqueID( it->second.handshake->getMessageManagerId() ); 544 545 PRINT(0)("handshake finished id=%d\n", it->second.handshake->getNetworkGameManagerId()); 546 it->second.handshake->del(); 549 547 } 550 548 else 551 assert(false); 552 553 549 this->handleReconnect( it->second.userId); 554 550 555 551 } … … 623 619 // reject the server 624 620 pInfo->handshake->doReject( "redirected to different server"); 621 pInfo->handshake->del(); 625 622 626 623 // flush the old synchronization states, since the numbering could be completely different … … 634 631 // pInfo->socket->reconnectToServer( proxyIP.ipString(), proxyIP.port()); 635 632 this->handleDisconnect( userId); 636 //this->connectToProxyServer(proxyIP.ipString(), 9999);633 this->connectToProxyServer(proxyIP.ipString(), 9999); 637 634 #warning the ports are not yet integrated correctly in the ip class 638 635 639 636 // and restart the handshake 640 //this->startHandshake( userId);637 this->startHandshake( userId); 641 638 } 642 639
Note: See TracChangeset
for help on using the changeset viewer.