Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9473 in orxonox.OLD


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

letting proxys handshakes handling again

Location:
branches/proxy/src/lib/network
Files:
3 edited

Legend:

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

    r9406 r9473  
    7676  remoteState.orxId = 0;
    7777  remoteState.version = 0;
    78   remoteState.nodeType = NET_CLIENT;
     78  remoteState.nodeType = NET_UNASSIGNED;
    7979  remoteState.canDel = 0;
    8080
  • branches/proxy/src/lib/network/netdefs.h

    r9458 r9473  
    4747//!< enum indicating the type of the node
    4848typedef enum {
    49   NET_MASTER_SERVER,
     49  NET_UNASSIGNED              = -1,
     50
     51  NET_MASTER_SERVER           =  0,
    5052  NET_PROXY_SERVER_ACTIVE,
    5153  NET_PROXY_SERVER_PASSIVE,
  • branches/proxy/src/lib/network/network_stream.cc

    r9472 r9473  
    6565  this->init();
    6666  /* initialize the references */
    67   this->pInfo->nodeType = NET_CLIENT;
     67  this->pInfo->nodeType = NET_UNASSIGNED;
    6868}
    6969
     
    552552        if ( it->second.handshake->ok() )
    553553        {
     554          // write the first informations into the node so they can be read from there for case differentiation
     555          it->second.nodeType = it->second.handshake->getRemoteNodeType();
     556          it->second.ip = it->second.socket->getRemoteAddress();
     557
    554558          // the counter part didn't mark it free for deletion yet
    555559          if ( !it->second.handshake->allowDel() )
    556560          {
    557             // make sure this is a client
    558             if(  SharedNetworkData::getInstance()->isClient() || SharedNetworkData::getInstance()->isProxyServerActive())
     561            // make sure this is a connection:
     562            // - client       <==> master server
     563            // - proxy server <==> master server
     564            if(  SharedNetworkData::getInstance()->isClient() || SharedNetworkData::getInstance()->isProxyServerActive() && it->second.isMasterServer())
    559565            {
    560566              SharedNetworkData::getInstance()->setHostID( it->second.handshake->getHostId() );
    561567              this->pInfo->userId = SharedNetworkData::getInstance()->getHostID();
    562568
    563               it->second.nodeType = it->second.handshake->getRemoteNodeType();
    564               it->second.ip = it->second.socket->getRemoteAddress();
     569//               it->second.nodeType = it->second.handshake->getRemoteNodeType();
     570//               it->second.ip = it->second.socket->getRemoteAddress();
    565571              // add the new server to the nodes list (it can be a NET_MASTER_SERVER or NET_PROXY_SERVER)
    566572              this->networkMonitor->addNode(&it->second);
     
    595601              if (  SharedNetworkData::getInstance()->isMasterServer() )
    596602              {
    597                 it->second.nodeType = it->second.handshake->getRemoteNodeType();
    598                 it->second.ip = it->second.socket->getRemoteAddress();
    599 
    600603                this->networkMonitor->addNode(&it->second);
    601604
     
    753756
    754757      // if we are a server (both master and proxy servers) and this is not our handshake
    755       if ( ( SharedNetworkData::getInstance()->isMasterServer() /*|| SharedNetworkData::getInstance()->isProxyServerActive()*/ ) && sync.getLeafClassID() == CL_HANDSHAKE && sync.getUniqueID() != peer->second.userId )
     758      if ( ( SharedNetworkData::getInstance()->isMasterServer() ||
     759             SharedNetworkData::getInstance()->isProxyServerActive() &&  peer->second.isClient())
     760             && sync.getLeafClassID() == CL_HANDSHAKE && sync.getUniqueID() != peer->second.userId )
    756761        continue;
    757762
     
    767772
    768773      // server fakes uniqueid == 0 for handshake
    769       if ( ( SharedNetworkData::getInstance()->isMasterServer() /*|| SharedNetworkData::getInstance()->isProxyServerActive() */) &&
     774      if ( ( SharedNetworkData::getInstance()->isMasterServer() ||
     775             SharedNetworkData::getInstance()->isProxyServerActive() &&  peer->second.isClient() ) &&
    770776             sync.getUniqueID() <= SharedNetworkData::getInstance()->getMaxPlayer() + 1) // plus one to handle one client more than the max to redirect it
    771777        n = Converter::intToByteArray( 0, buf + offset, UDP_PACKET_SIZE - offset );
Note: See TracChangeset for help on using the changeset viewer.