Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 17, 2006, 5:47:32 PM (18 years ago)
Author:
patrick
Message:

proxy server ip synchronizeing bug, nodes get registered

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/proxy/src/lib/network/network_stream.cc

    r9303 r9308  
    8181  this->peers[0].nodeType = NET_MASTER_SERVER;
    8282  this->peers[0].connectionMonitor = new ConnectionMonitor( 0 );
    83   this->peers[0].ip = this->peers[0].socket->getDestAddress();
     83  this->peers[0].ip = this->peers[0].socket->getRemoteAddress();
    8484  // and set also the localhost
    8585  this->pInfo->nodeType = NET_CLIENT;
    8686  // get the local ip address
    87   SDLNet_ResolveHost( &this->pInfo->ip, "localhost", port );
    88 
     87  SDLNet_ResolveHost( &this->pInfo->ip, NULL, port );
    8988}
    9089
     
    10099  this->pInfo->nodeType = NET_MASTER_SERVER;
    101100  // get the local ip address
    102   SDLNet_ResolveHost( &this->pInfo->ip, "localhost", port );
     101  SDLNet_ResolveHost( &this->pInfo->ip, NULL, port );
    103102}
    104103
     
    204203  hs->setPreferedNickName( Preferences::getInstance()->getString( "multiplayer", "nickname", "Player" ) );
    205204
    206 //   peers[0].handshake->setSynchronized( true );
    207   //this->connectSynchronizeable(*hs);
    208   //this->connectSynchronizeable(*hs);
    209205  PRINTF(0)("NetworkStream: Handshake created: %s\n", hs->getName());
    210206}
     
    305301
    306302/**
    307  * if we are a server update the connection list to accept new connections (clients)
    308  * also start the handsake for the new clients
     303 * 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
    309305 */
    310306void NetworkStream::updateConnectionList( )
     
    326322      peers[clientId].handshake = new Handshake(this->pInfo->nodeType, clientId, this->networkGameManager->getUniqueID(), MessageManager::getInstance()->getUniqueID() );
    327323      peers[clientId].handshake->setUniqueID(clientId);
     324      peers[clientId].ip = tempNetworkSocket->getRemoteAddress();
    328325
    329326      // get the proxy server informations and write them to the handshake, if any (proxy)
     
    501498
    502499              it->second.nodeType = it->second.handshake->getRemoteNodeType();
    503               it->second.ip = it->second.socket->getDestAddress();
     500              it->second.ip = it->second.socket->getRemoteAddress();
    504501              this->networkMonitor->addNode(&it->second);
    505502
    506503              // 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);
    508505              // 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);
    510507
    511508
     
    520517                // disconnect from the current server and reconnect to proxy server
    521518//                 it->second.socket->disconnectServer();
    522 
    523519              }
    524520
     
    537533          else
    538534          {
    539             // handsheke finished registring new player
     535            // handshake finished registring new player
    540536            if ( it->second.handshake->canDel() )
    541537            {
     
    543539              {
    544540                it->second.nodeType = it->second.handshake->getRemoteNodeType();
     541                it->second.ip = it->second.socket->getRemoteAddress();
     542
    545543                this->networkMonitor->addNode(&it->second);
    546544
Note: See TracChangeset for help on using the changeset viewer.