Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9350 in orxonox.OLD for branches


Ignore:
Timestamp:
Jul 20, 2006, 12:06:49 PM (18 years ago)
Author:
patrick
Message:

handshake now waits for ip list sync

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

Legend:

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

    r9349 r9350  
    4848  registerVar( new SynchronizeableString( &localState.preferedNickName, &remoteState.preferedNickName, "preferedNickName", PERMISSION_ALL ) );
    4949  // now synchronize only two of the available proxy server addresses
    50   registerVar( new SynchronizeableIP( &localState.proxy1, &remoteState.proxy1, "proxy server 1", PERMISSION_ALL ) );
    51   registerVar( new SynchronizeableIP( &localState.proxy2, &remoteState.proxy2, "proxy server 2", PERMISSION_ALL ) );
     50  proxy1Handler = registerVarId( new SynchronizeableIP( &localState.proxy1, &remoteState.proxy1, "proxy server 1", PERMISSION_ALL ) );
     51  proxy2Handler = registerVarId( new SynchronizeableIP( &localState.proxy2, &remoteState.proxy2, "proxy server 2", PERMISSION_ALL ) );
    5252
    5353  // init the local state
     
    8181  remoteState.proxy1 = IP(0, 0);
    8282  remoteState.proxy2 = IP(0, 0);
     83
     84
     85  this->proxyAddressesSynched = 0;
     86
    8387
    8488  // activate the synchronization process
     
    143147    }
    144148
     149    // the first proxy server synched
     150    if( *it == this->proxy1Handler)
     151    {
     152      this->proxyAddressesSynched++;
     153    }
     154
     155    // the last proxy server synched
     156    if( *it == this->proxy2Handler)
     157    {
     158      this->proxyAddressesSynched++;
     159    }
     160
    145161  }
    146162
    147163  // handshake completed
    148164  if ( remoteState.orxId == _ORXONOX_ID &&
    149        remoteState.version == _ORXONOX_VERSION )
     165       remoteState.version == _ORXONOX_VERSION &&
     166       this->proxyAddressesSynched  == 2)
    150167  {
    151168    localState.completed = 1;
  • branches/proxy/src/lib/network/handshake.h

    r9347 r9350  
    109109    int                hostId_handler;                        //!< host id handler
    110110    int                nodeTypeHandler;                       //!< node type handler
     111    int                proxy1Handler;                         //!< handler for the proxy
     112    int                proxy2Handler;                         //!< handler for the proxy
    111113
    112114    int                completed_handler;                     //!< handshake completion handler
     
    116118    int                nodeType;                              //!, the type of the network node
    117119
     120    int                proxyAddressesSynched;                 //!< number of addresses synched
     121
    118122};
    119123
Note: See TracChangeset for help on using the changeset viewer.