Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 25, 2006, 1:35:29 AM (18 years ago)
Author:
patrick
Message:

network: some more degbug ability for pnode, started work on water synchronization

File:
1 edited

Legend:

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

    r6678 r6685  
    407407  e = this->networkStream->getSyncEnd();
    408408
     409  // send the packet header
    409410  if ( !writeToClientBuffer( outBuffer[userID], (byte)NET_CREATE_ENTITY_LIST ) )
    410411    return;
    411412
    412   // -2 because you must not send network_game_manager and handshake
     413  // send the number of entities: -2 because you must not send network_game_manager and handshake
    413414  if ( !writeToClientBuffer( outBuffer[userID], networkStream->getSyncCount() ) )
    414415    return;
     
    416417  //PRINTF(0)("SendEntityList: n = %d\n", networkStream->getSyncCount()-2 );
    417418
    418   int n = 0;
    419 
     419  // first send the NullParent
     420  if ( !writeToClientBuffer( outBuffer[userID], (int)PNode::getNullParent()->getLeafClassID()) )
     421    return;
     422  if ( !writeToClientBuffer( outBuffer[userID], (int)PNode::getNullParent()->getUniqueID()) )
     423    return;
     424  if ( !writeToClientBuffer( outBuffer[userID], (int)PNode::getNullParent()->getOwner()) )
     425    return;
     426
     427  // now send the rest of the entities
    420428  while ( it != e )
    421429  {
    422     if( (*it)->beSynchronized())
     430    if( (*it)->beSynchronized() && (*it) != PNode::getNullParent())
    423431    {
    424432      PRINTF(0)("SENDING ENTITY %s classid: %x, uniqueid %d\n", (*it)->getClassName(), (*it)->getLeafClassID(), (*it)->getUniqueID() );
     
    489497  if( classID == CL_NULL_PARENT)
    490498  {
    491     b = PNode::getNullParent();
     499    b = (BaseObject*)PNode::getNullParent();
    492500  }
    493501  else
     
    806814    {
    807815      BaseObject* b = doCreateEntity( (ClassID)classID, uniqueID, owner );
    808 
    809       /*if ( b != NULL )
    810       {
    811         if ( b->isA(CL_WORLD_ENTITY) )
    812         {
    813           int n = dynamic_cast<WorldEntity*>(b)->writeState( data, length, sender );
    814 
    815           i += n;
    816         }
    817     }*/
    818816    }
    819817
Note: See TracChangeset for help on using the changeset viewer.