Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9472 in orxonox.OLD


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

switching to hybrind, so far so good

File:
1 edited

Legend:

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

    r9471 r9472  
    313313  }
    314314
    315   if ( this->pInfo->isMasterServer())
     315  if ( SharedNetworkData::getInstance()->isMasterServer())
    316316  {
    317317    // execute everytthing the master server shoudl do
     
    323323    this->updateConnectionList();
    324324  }
    325 //   else if( this->pInfo->isProxyServerActive())
    326 //   {
    327     // execute everything the proxy server should do
    328 
    329 //     if ( this->clientSocket )
    330 //       this->clientSocket->update();
    331 //     if( this->proxySocket)
    332 //       this->proxySocket->update();
    333 //
    334 //     this->updateConnectionList();
    335 //   }
    336   else
     325  else if( SharedNetworkData::getInstance()->isProxyServerActive())
     326  {
     327    //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  }
     335
     336#warning make this more modular: every proxy/master server connection should be watched for termination
     337  if( !SharedNetworkData::getInstance()->isMasterServer())
    337338  {
    338339    // check if the connection is ok else terminate and remove
    339 #warning make this more modular: every proxy/master server connection should be watched for termination
    340340    if ( !peers.empty() && peers[NET_ID_MASTER_SERVER].socket &&
    341341          ( !peers[NET_ID_MASTER_SERVER].socket->isOk() ||
     
    607607                }
    608608              }
    609 #warning no proxys cant accept clients anymore: uncomment the following lines. (uncommented becaus the proxy probably cant connect to another server as this
    610 //               else if ( this->pInfo->isProxyServerActive() )
    611 //               {
    612 //                 it->second.nodeType = it->second.handshake->getRemoteNodeType();
    613 //                 it->second.ip = it->second.socket->getRemoteAddress();
    614 //
    615 //                 this->networkMonitor->addNode(&it->second);
    616 //
    617 //                 this->handleNewClient( it->second.userId );
    618 //
    619 //                 if ( PlayerStats::getStats( it->second.userId ) && it->second.handshake->getPreferedNickName() != "" )
    620 //                 {
    621 //                   PlayerStats::getStats( it->second.userId )->setNickName( it->second.handshake->getPreferedNickName() );
    622 //                 }
    623 //               }
     609              else if ( SharedNetworkData::getInstance()->isProxyServerActive() && it->second.isClient() )
     610              {
     611                it->second.nodeType = it->second.handshake->getRemoteNodeType();
     612                it->second.ip = it->second.socket->getRemoteAddress();
     613
     614                this->networkMonitor->addNode(&it->second);
     615
     616                this->handleNewClient( it->second.userId );
     617
     618                if ( PlayerStats::getStats( it->second.userId ) && it->second.handshake->getPreferedNickName() != "" )
     619                {
     620                  PlayerStats::getStats( it->second.userId )->setNickName( it->second.handshake->getPreferedNickName() );
     621                }
     622              }
    624623
    625624              PRINT(0)("handshake finished delete it\n");
Note: See TracChangeset for help on using the changeset viewer.