Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7792 in orxonox.OLD


Ignore:
Timestamp:
May 24, 2006, 11:38:51 AM (18 years ago)
Author:
rennerc
Message:

fixed bug

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

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/network/connection_monitor.cc

    r7778 r7792  
    8181    ackDelay.push_back( tick - sentStateTicks[ackedState] );
    8282  }
    83      
    84   while ( sentStateTicks.begin()->first <= ackedState )
     83 
     84  while ( sentStateTicks.begin() != sentStateTicks.end() && sentStateTicks.begin()->first <= ackedState )
    8585    sentStateTicks.erase( sentStateTicks.begin() );
    8686     
  • branches/network/src/lib/network/handshake.cc

    r7778 r7792  
    4141  errorString_handler = registerVarId( new SynchronizeableString( &localState.errorString, &remoteState.errorString, "errorString", PERMISSION_ALL ) );
    4242 
    43   localState.completed = false;
     43  localState.completed = 0;
    4444  localState.error = 0;
    4545  localState.errorString = "";
     
    5050  localState.version = _ORXONOX_VERSION;
    5151 
    52   remoteState.completed = false;
     52  remoteState.completed = 0;
    5353  remoteState.error = 0;
    5454  remoteState.errorString = "";
     
    7676      {
    7777        localState.error = 1;
    78         localState.completed = true;
     78        localState.completed = 1;
    7979        localState.errorString = "Seems not to be orxonox!";
    80         return;
     80        continue;
    8181      }
    82       else
    83         localState.completed = true;
     82
    8483    }
    8584     
     
    8988      {
    9089        localState.error = 2;
    91         localState.completed = true;
     90        localState.completed = 1;
    9291        localState.errorString = "Versions of server and client do not match!";
    93         return;
     92        continue;
    9493      }
    95       else
    96         localState.completed = true;
     94
    9795    }
    9896   
    9997  }
     98 
     99  if (
     100      remoteState.orxId == _ORXONOX_ID &&
     101      remoteState.version == _ORXONOX_VERSION
     102     )
     103    localState.completed = true;
    100104}
    101105
  • branches/network/src/lib/network/network_stream.cc

    r7778 r7792  
    196196  cleanUpOldSyncList();
    197197  handleHandshakes();
     198 
     199  handleDownstream();
    198200  handleUpstream();
    199   handleDownstream();
    200201
    201202}
     
    250251  }
    251252
    252 
    253253  //check if connections are ok else remove them
    254254  for ( PeerList::iterator it = peers.begin(); it != peers.end(); it++ )
    255255  {
    256     //TODO check for timeout
    257256    if ( 
    258           (it->second.socket && !it->second.socket->isOk() ) ||
    259           it->second.connectionMonitor->hasTimedOut()
     257          it->second.socket &&
     258          (
     259            !it->second.socket->isOk()  ||
     260            it->second.connectionMonitor->hasTimedOut()
     261          )
    260262       )
    261263    {
     
    337339            MessageManager::getInstance()->setUniqueID( it->second.handshake->getMessageManagerId() );
    338340          }
     341          else
     342            handleNewClient( it->second.userId );
    339343
    340344          PRINT(0)("handshake finished id=%d\n", it->second.handshake->getNetworkGameManagerId());
     
    342346          delete it->second.handshake;
    343347          it->second.handshake = NULL;
    344          
    345           handleNewClient( it->second.userId );
     348
    346349        }
    347350        else
     
    504507        if ( sync == NULL )
    505508        {
     509          PRINTF(0)("could not find sync with id %d. try to create it\n", uniqueId);
    506510          if ( oldSynchronizeables.find( uniqueId ) != oldSynchronizeables.end() )
    507511          {
     
    524528
    525529          Converter::byteArrayToInt( buf + offset, &leafClassId );
     530         
     531          assert( leafClassId != 0 );
    526532       
    527           BaseObject * b;
     533          BaseObject * b = NULL;
    528534          /* These are some small exeptions in creation: Not all objects can/should be created via Factory */
    529535          /* Exception 1: NullParent */
    530           if( leafClassId == CL_NULL_PARENT || leafClassId == CL_SYNCHRONIZEABLE )
     536          if( leafClassId == CL_NULL_PARENT || leafClassId == CL_SYNCHRONIZEABLE || leafClassId == CL_NETWORK_GAME_MANAGER )
    531537          {
    532538            PRINTF(1)("Can not create Class with ID %x!\n", (int)leafClassId);
     
    573579   
    574580      peer->second.lastAckedState = ackedState;
     581     
    575582      peer->second.lastRecvedState = state;
    576583     
Note: See TracChangeset for help on using the changeset viewer.