Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6662 in orxonox.OLD for branches/network/src/lib


Ignore:
Timestamp:
Jan 23, 2006, 4:12:02 PM (19 years ago)
Author:
patrick
Message:

network: now sync is on the road again, clients segfaults on assertion

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

Legend:

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

    r6661 r6662  
    2323
    2424Handshake::Handshake( bool server, int clientId, int networkGameManagerId )
     25  : Synchronizeable()
    2526{
    2627  /* set the class id for the base object */
  • branches/network/src/lib/network/network_game_manager.cc

    r6661 r6662  
    249249      s->setUniqueID( newUniqueID++ );
    250250      s->setOwner( 0 );
     251      // all entities created via this function are added automaticaly to the synchronizeable list
     252      s->setSynchronized(true);
    251253      return b;
    252254    }
     
    408410  while ( it != e )
    409411  {
    410     PRINTF(5)("SENDING ENTITY %s id %d\n", (*it)->getClassName(), (*it)->getUniqueID() );
    411     if ( !writeToClientBuffer( outBuffer[userID], (int)((*it)->getLeafClassID()) ) )
    412       return;
    413 
    414     if ( !writeToClientBuffer( outBuffer[userID], (int)((*it)->getUniqueID()) ) )
    415       return;
    416 
    417     if ( !writeToClientBuffer( outBuffer[userID], (int)((*it)->getOwner()) ) )
    418       return;
    419 
     412    if( (*it)->beSynchronized())
     413    {
     414      PRINTF(0)("SENDING ENTITY %s id %d\n", (*it)->getClassName(), (*it)->getUniqueID() );
     415      if ( !writeToClientBuffer( outBuffer[userID], (int)((*it)->getLeafClassID()) ) )
     416        return;
     417
     418      if ( !writeToClientBuffer( outBuffer[userID], (int)((*it)->getUniqueID()) ) )
     419        return;
     420
     421      if ( !writeToClientBuffer( outBuffer[userID], (int)((*it)->getOwner()) ) )
     422        return;
     423    }
    420424    it++;
    421425  }
     
    481485    s->setUniqueID( uniqueID );
    482486    s->setOwner( owner );
    483     this->networkStream->connectSynchronizeable( *s );
     487    //this->networkStream->connectSynchronizeable( *s );
    484488    if ( !isServer() )
    485489      s->setIsOutOfSync( true );
  • branches/network/src/lib/network/network_manager.cc

    r6660 r6662  
    101101
    102102  this->defaultSyncStream = new NetworkStream(ipAddress);
     103  this->defaultSyncStream->startHandshake();
    103104  return 1;
    104105}
Note: See TracChangeset for help on using the changeset viewer.