Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 25, 2006, 10:23:17 PM (18 years ago)
Author:
patrick
Message:

heavy permissions fight: no node was ever thought to be client and server at the same time, proxy server are hybrid nodes so there is need for a big framework extension.

  • made the obb creation saver
  • prevented segfaults in the aabb tree creation, this was very dangerous code
  • inserted handshake hack to make the handshake work.

No I will have to get the handshake right so the node works correctly

File:
1 edited

Legend:

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

    r9468 r9470  
    208208 * @param port: the port number
    209209 */
    210 void NetworkStream::connectToProxyServer(int proxyId,std::string host, int port)
     210void NetworkStream::connectToProxyServer(int proxyId, std::string host, int port)
    211211{
    212212  PRINTF(0)("connect to proxy %s, this is proxyId %i\n", host.c_str(), proxyId);
     
    253253void NetworkStream::startHandshake(int userId)
    254254{
    255   Handshake* hs = new Handshake(this->pInfo->nodeType);
     255  Handshake* hs = new Handshake(NET_CLIENT/* this->pInfo->nodeType*/);
    256256  // fake the unique id
    257257  hs->setUniqueID( NET_UID_HANDSHAKE );
     
    323323    this->updateConnectionList();
    324324  }
    325   else if( this->pInfo->isProxyServerActive())
    326   {
     325//   else if( this->pInfo->isProxyServerActive())
     326//   {
    327327    // execute everything the proxy server should do
    328     if ( this->clientSocket )
    329       this->clientSocket->update();
    330     if( this->proxySocket)
    331       this->proxySocket->update();
    332 
    333     this->updateConnectionList();
    334   }
     328
     329//     if ( this->clientSocket )
     330//       this->clientSocket->update();
     331//     if( this->proxySocket)
     332//       this->proxySocket->update();
     333//
     334//     this->updateConnectionList();
     335//   }
    335336  else
    336337  {
     
    554555          {
    555556            // make sure this is a client
    556             if( this->pInfo->isClient())
     557            if( this->pInfo->isClient() || SharedNetworkData::getInstance()->isProxyServerActive())
    557558            {
    558559              SharedNetworkData::getInstance()->setHostID( it->second.handshake->getHostId() );
     
    752753
    753754      // if we are a server (both master and proxy servers) and this is not our handshake
    754       if ( ( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServerActive() ) && sync.getLeafClassID() == CL_HANDSHAKE && sync.getUniqueID() != peer->second.userId )
     755      if ( ( SharedNetworkData::getInstance()->isMasterServer() /*|| SharedNetworkData::getInstance()->isProxyServerActive()*/ ) && sync.getLeafClassID() == CL_HANDSHAKE && sync.getUniqueID() != peer->second.userId )
    755756        continue;
    756757
     
    766767
    767768      // server fakes uniqueid == 0 for handshake
    768       if ( ( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServerActive() ) &&
     769      if ( ( SharedNetworkData::getInstance()->isMasterServer() /*|| SharedNetworkData::getInstance()->isProxyServerActive() */) &&
    769770             sync.getUniqueID() <= SharedNetworkData::getInstance()->getMaxPlayer() + 1) // plus one to handle one client more than the max to redirect it
    770771        n = Converter::intToByteArray( 0, buf + offset, UDP_PACKET_SIZE - offset );
     
    818819    // now compress the data with the zip library
    819820    int compLength = 0;
    820     if ( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServerActive())
     821    if ( SharedNetworkData::getInstance()->isMasterServer() /*|| SharedNetworkData::getInstance()->isProxyServerActive()*/)
    821822      compLength = Zip::getInstance()->zip( buf, offset, compBuf, UDP_PACKET_SIZE, dictServer );
    822823    else
     
    936937
    937938          // if the node we got this unknown sync from is a client we ignore it (since it has no rights to create a new sync)
    938           if ( peers[peer->second.userId].isClient() )
     939          if ( peers[peer->second.userId].isClient() || peers[peer->second.userId].isProxyServerActive())
    939940          {
    940941            offset += syncDataLength;
Note: See TracChangeset for help on using the changeset viewer.