Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9309 in orxonox.OLD


Ignore:
Timestamp:
Jul 18, 2006, 12:57:07 AM (18 years ago)
Author:
patrick
Message:

client ip bug

File:
1 edited

Legend:

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

    r9308 r9309  
    322322      peers[clientId].handshake = new Handshake(this->pInfo->nodeType, clientId, this->networkGameManager->getUniqueID(), MessageManager::getInstance()->getUniqueID() );
    323323      peers[clientId].handshake->setUniqueID(clientId);
    324       peers[clientId].ip = tempNetworkSocket->getRemoteAddress();
    325 
    326       // get the proxy server informations and write them to the handshake, if any (proxy)
    327       PeerInfo* pi = this->networkMonitor->getFirstChoiceProxy();
    328       if( pi != NULL)
    329         peers[clientId].handshake->setProxy1Address( pi->ip);
    330       pi = this->networkMonitor->getSecondChoiceProxy();
    331       if( pi != NULL)
    332         peers[clientId].handshake->setProxy2Address( pi->ip);
    333 
    334        // check if the connecting client should reconnect to a proxy server
    335       peers[clientId].handshake->setRedirect(this->networkMonitor->reconnectNextClient());
    336324
    337325      peers[clientId].connectionMonitor = new ConnectionMonitor( clientId );
    338326      peers[clientId].userId = clientId;
    339       peers[clientId].nodeType = NET_CLIENT;
    340327    }
    341328    else
     
    351338      peers[clientId].handshake = new Handshake(this->pInfo->nodeType, clientId, this->networkGameManager->getUniqueID(), MessageManager::getInstance()->getUniqueID());
    352339      peers[clientId].handshake->setUniqueID(clientId);
    353       // get the proxy server informations and write them to the handshake, if any (proxy)
    354       PeerInfo* pi = this->networkMonitor->getFirstChoiceProxy();
    355       if( pi != NULL)
    356         peers[clientId].handshake->setProxy1Address( pi->ip);
    357       pi = this->networkMonitor->getSecondChoiceProxy();
    358       if( pi != NULL)
    359         peers[clientId].handshake->setProxy2Address( pi->ip);
    360 
    361        // check if the connecting client should reconnect to a proxy server
    362       peers[clientId].handshake->setRedirect(this->networkMonitor->reconnectNextClient());
    363340
    364341      peers[clientId].connectionMonitor = new ConnectionMonitor( clientId );
    365342      peers[clientId].userId = clientId;
    366       peers[clientId].nodeType = NET_CLIENT;
    367343
    368344      PRINTF(0)("num sync: %d\n", synchronizeables.size());
    369345    }
     346
     347
     348    // get the proxy server informations and write them to the handshake, if any (proxy)
     349    PeerInfo* pi = this->networkMonitor->getFirstChoiceProxy();
     350    if( pi != NULL)
     351      peers[clientId].handshake->setProxy1Address( pi->ip);
     352
     353    pi = this->networkMonitor->getSecondChoiceProxy();
     354    if( pi != NULL)
     355      peers[clientId].handshake->setProxy2Address( pi->ip);
     356
     357    // check if the connecting client should reconnect to a proxy server
     358    peers[clientId].handshake->setRedirect(this->networkMonitor->reconnectNextClient());
     359
     360
     361    peers[clientId].nodeType = NET_CLIENT;
     362    peers[clientId].ip = peers[clientId].socket->getRemoteAddress();
     363
    370364
    371365    // check if there are too many clients connected (DEPRECATED: new: the masterserver sends a list of proxy servers)
Note: See TracChangeset for help on using the changeset viewer.