Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6892 in orxonox.OLD for branches/network


Ignore:
Timestamp:
Jan 31, 2006, 2:28:45 PM (19 years ago)
Author:
rennerc
Message:
 
Location:
branches/network/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/coord/p_node.cc

    r6815 r6892  
    12531253  SYNCHELP_WRITE_BEGIN();
    12541254
    1255   if ( this->getHostID()!=this->getOwner() )
     1255  if ( this->getHostID()!=0 && this->getHostID()!=this->getOwner() )
    12561256  {
    12571257    return SYNCHELP_WRITE_N;
     
    12721272
    12731273  SYNCHELP_WRITE_BYTE( flags, NWT_PN_FLAGS );
    1274   //PRINTF(0)("FLAGS = %d\n", flags);
     1274  PRINTF(0)("FLAGS = %d\n", flags);
    12751275
    12761276  if ( flags & __FLAG_COOR )
    12771277  {
    12781278
    1279     //PRINTF(0)("SEND COOR: %f %f %f\n", this->relCoordinate.x, this->relCoordinate.y, this->relCoordinate.z);
     1279    PRINTF(0)("SEND COOR: %f %f %f\n", this->relCoordinate.x, this->relCoordinate.y, this->relCoordinate.z);
    12801280
    12811281    SYNCHELP_WRITE_FLOAT( this->relCoordinate.x, NWT_PN_SCOORX );
     
    12911291  {
    12921292
    1293     //PRINTF(0)("SEND QUAT: %f %f %f %f\n", this->absDirection.w, this->absDirection.v.x, this->absDirection.v.y, this->absDirection.v.z);
     1293    PRINTF(0)("SEND QUAT: %f %f %f %f\n", this->absDirection.w, this->absDirection.v.x, this->absDirection.v.y, this->absDirection.v.z);
    12941294
    12951295    SYNCHELP_WRITE_FLOAT( this->absDirection.w, NWT_PN_SROTV );
  • branches/network/src/lib/network/network_game_manager.cc

    r6868 r6892  
    895895  i += Converter::byteArrayToInt( &data[i], &uniqueID );
    896896
     897  PRINTF(0)("handleRequestSync %d %d\n", uniqueID, sender);
    897898  doRequestSync( uniqueID, sender );
    898899
     
    980981void NetworkGameManager::executeRequestSync( int uniqueID, int user )
    981982{
     983  PRINTF(0)("executeRequestSync %d %d\n", uniqueID, user);
    982984  if ( user >= outBuffer.size() )
    983985    resizeBufferVector( user );
  • branches/network/src/lib/network/network_stream.cc

    r6868 r6892  
    231231  int reciever;
    232232  Header header;
     233  int counter;
     234 
    233235  for (SynchronizeableList::iterator it = synchronizeables.begin(); it!=synchronizeables.end(); it++)
    234236  {
     237    counter = 0;
     238   
    235239    if ( (*it)!=NULL && (*it)->beSynchronized() /*&& (*it)->getOwner() == myHostId*/ )
    236240    {
    237241      do {
     242        counter++;
     243       
     244        //check for endless loop
     245        if ( counter > 50 )
     246        {
     247          PRINTF(1)("there seems to be an error in readBytes of %s\n", (*it)->getClassName());
     248          assert(false);
     249        }
     250       
    238251        reciever = 0;
    239252        dataLength = (*it)->readBytes(downBuffer, DATA_STREAM_BUFFER_SIZE, &reciever);
    240 
    241253
    242254        if ( dataLength<=0 ){
     
    267279            for ( int i = 0; i<networkSockets.size(); i++)
    268280            {
    269               if ( i!=-reciever && networkSockets[i] != NULL )
     281              if ( i!=abs(reciever) && networkSockets[i] != NULL )
    270282              {
    271                 PRINTF(5)("write %d bytes to socket %d\n", dataLength, i);
     283                PRINTF(0)("write %d bytes to socket %d uniqueid %d reciever %d\n", dataLength, i, (*it)->getUniqueID(), reciever);
    272284                networkSockets[i]->writePacket(downBuffer, dataLength);
    273285              }
  • branches/network/src/world_entities/space_ships/space_ship.cc

    r6868 r6892  
    651651  }
    652652
    653   *reciever = -this->getOwner();
     653  *reciever = 0 - this->getOwner();
     654  //TODO: implement with SYNCHELP_WRITE_SENT()
    654655  bool sentSomething = false;
    655656
    656   if ( ( this->getHostID()==0 || this->getOwner() == this->getHostID() ) && PNode::needsReadSync() )
    657   {
     657  if ( PNode::needsReadSync() && ( this->getHostID()==0 || this->getOwner() == this->getHostID() ) )
     658  {
     659    PRINTF(0)("sending PNode::readSync\n");
    658660    SYNCHELP_WRITE_BYTE( DATA_sync, NWT_SS_B );
    659661    SYNCHELP_WRITE_FKT( PNode::readSync, NWT_SS_PN_SYNC );
     662    sentSomething = true;
    660663  }
    661664
     
    683686    {
    684687      oldMask = mask;
     688      PRINTF(0)("sending mask\n");
    685689      sentSomething = true;
    686690      SYNCHELP_WRITE_BYTE( DATA_flags, NWT_SS_B );
     
    710714    {
    711715      oldVelocity = velocity;
    712       //PRINTF(0)("SENDING velocity\n");
     716      PRINTF(0)("SENDING velocity\n");
    713717      //SYNCHELP_WRITE_BYTE( DATA_velocity, NWT_SS_B );
    714718      //SYNCHELP_WRITE_FLOAT( velocity.x, NWT_SS_VELX );
     
    720724    {
    721725      sentSomething = true;
     726      PRINTF(0)("SYNCHELP_WRITE_FKT( Playable::readSync, NWT_SS_PL_SYNC )\n");
    722727      SYNCHELP_WRITE_BYTE( DATA_playables, NWT_SS_B );
    723728      SYNCHELP_WRITE_FKT( Playable::readSync, NWT_SS_PL_SYNC );
     
    727732 
    728733  if ( !sentSomething )
    729     reciever = 0;
     734    *reciever = 0;
    730735
    731736  return SYNCHELP_WRITE_N;
Note: See TracChangeset for help on using the changeset viewer.