Changeset 9308 in orxonox.OLD for branches/proxy/src/lib/network/network_stream.cc
- Timestamp:
- Jul 17, 2006, 5:47:32 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/network/network_stream.cc
r9303 r9308 81 81 this->peers[0].nodeType = NET_MASTER_SERVER; 82 82 this->peers[0].connectionMonitor = new ConnectionMonitor( 0 ); 83 this->peers[0].ip = this->peers[0].socket->get DestAddress();83 this->peers[0].ip = this->peers[0].socket->getRemoteAddress(); 84 84 // and set also the localhost 85 85 this->pInfo->nodeType = NET_CLIENT; 86 86 // get the local ip address 87 SDLNet_ResolveHost( &this->pInfo->ip, "localhost", port ); 88 87 SDLNet_ResolveHost( &this->pInfo->ip, NULL, port ); 89 88 } 90 89 … … 100 99 this->pInfo->nodeType = NET_MASTER_SERVER; 101 100 // get the local ip address 102 SDLNet_ResolveHost( &this->pInfo->ip, "localhost", port );101 SDLNet_ResolveHost( &this->pInfo->ip, NULL, port ); 103 102 } 104 103 … … 204 203 hs->setPreferedNickName( Preferences::getInstance()->getString( "multiplayer", "nickname", "Player" ) ); 205 204 206 // peers[0].handshake->setSynchronized( true );207 //this->connectSynchronizeable(*hs);208 //this->connectSynchronizeable(*hs);209 205 PRINTF(0)("NetworkStream: Handshake created: %s\n", hs->getName()); 210 206 } … … 305 301 306 302 /** 307 * if we are a server update the connection list to accept new connections (clients)308 * also start the handsake for the new clients303 * if we are a NET_MASTER_SERVER or NET_PROXY_SERVER_ACTIVE update the connection list to accept new 304 * connections (clients) also start the handsake for the new clients 309 305 */ 310 306 void NetworkStream::updateConnectionList( ) … … 326 322 peers[clientId].handshake = new Handshake(this->pInfo->nodeType, clientId, this->networkGameManager->getUniqueID(), MessageManager::getInstance()->getUniqueID() ); 327 323 peers[clientId].handshake->setUniqueID(clientId); 324 peers[clientId].ip = tempNetworkSocket->getRemoteAddress(); 328 325 329 326 // get the proxy server informations and write them to the handshake, if any (proxy) … … 501 498 502 499 it->second.nodeType = it->second.handshake->getRemoteNodeType(); 503 it->second.ip = it->second.socket->get DestAddress();500 it->second.ip = it->second.socket->getRemoteAddress(); 504 501 this->networkMonitor->addNode(&it->second); 505 502 506 503 // get proxy 1 address and add it 507 this->networkMonitor->addNode(it->second.handshake->getProxy1Address() );504 this->networkMonitor->addNode(it->second.handshake->getProxy1Address(), NET_PROXY_SERVER_ACTIVE); 508 505 // get proxy 2 address and add it 509 this->networkMonitor->addNode(it->second.handshake->getProxy2Address() );506 this->networkMonitor->addNode(it->second.handshake->getProxy2Address(), NET_PROXY_SERVER_ACTIVE); 510 507 511 508 … … 520 517 // disconnect from the current server and reconnect to proxy server 521 518 // it->second.socket->disconnectServer(); 522 523 519 } 524 520 … … 537 533 else 538 534 { 539 // handsh eke finished registring new player535 // handshake finished registring new player 540 536 if ( it->second.handshake->canDel() ) 541 537 { … … 543 539 { 544 540 it->second.nodeType = it->second.handshake->getRemoteNodeType(); 541 it->second.ip = it->second.socket->getRemoteAddress(); 542 545 543 this->networkMonitor->addNode(&it->second); 546 544
Note: See TracChangeset
for help on using the changeset viewer.