Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6867 in orxonox.OLD for branches


Ignore:
Timestamp:
Jan 30, 2006, 4:33:38 PM (19 years ago)
Author:
rennerc
Message:

commit before merge

Location:
branches/network/src
Files:
2 edited

Legend:

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

    r6737 r6867  
    263263        if ( reciever!=0 )
    264264        {
    265           if ( networkSockets[reciever] != NULL )
    266           {
    267             PRINTF(5)("write %d bytes to socket %d\n", dataLength, reciever);
    268             networkSockets[reciever]->writePacket(downBuffer, dataLength);
     265          if ( reciever < 0)
     266          {
     267            for ( int i = 0; i<networkSockets.size(); i++)
     268            {
     269              if ( i!=-reciever && networkSockets[i] != NULL )
     270              {
     271                PRINTF(5)("write %d bytes to socket %d\n", dataLength, i);
     272                networkSockets[i]->writePacket(downBuffer, dataLength);
     273              }
     274            }
    269275          }
    270276          else
    271277          {
    272             PRINTF(1)("networkSockets[reciever] == NULL\n");
     278            if ( networkSockets[reciever] != NULL )
     279            {
     280              PRINTF(5)("write %d bytes to socket %d\n", dataLength, reciever);
     281              networkSockets[reciever]->writePacket(downBuffer, dataLength);
     282            }
     283            else
     284            {
     285              PRINTF(1)("networkSockets[reciever] == NULL\n");
     286            }
    273287          }
    274288        }
  • branches/network/src/world_entities/space_ships/space_ship.cc

    r6866 r6867  
    563563       
    564564      }
     565      else
     566        assert(false);
    565567     
    566568      continue;
     
    576578        SYNCHELP_READ_FLOAT( mouseDir.v.z, NWT_SS_MOUSEDIRZ );
    577579      }
     580      else
     581        assert(false);
    578582     
    579583      continue;
     
    583587    {
    584588      if ( this->getOwner() != this->getHostID() )
     589      {
    585590        SYNCHELP_READ_FKT( PNode::writeSync, NWT_SS_PN_SYNC );
     591      }
     592      else
     593        assert(false);
    586594     
    587595      continue;
     
    595603        SYNCHELP_READ_FLOAT( velocity.y, NWT_SS_VELY );
    596604        SYNCHELP_READ_FLOAT( velocity.z, NWT_SS_VELZ );
    597       }
     605      }     
     606      else
     607        assert(false);
    598608     
    599609      continue;
     
    603613    {
    604614      if ( this->getOwner() != this->getHostID() )
     615      {
    605616        SYNCHELP_READ_FKT( Playable::writeSync, NWT_SS_PL_SYNC );
     617      }
     618      else
     619        assert(false);
    606620    }
    607621  }
     
    637651  }
    638652
    639   *reciever = 0;
     653  *reciever = -this->getOwner();
     654  bool sentSomething = false;
    640655 
    641656  if ( ( this->getHostID()==0 || this->getOwner() == this->getHostID() ) && PNode::needsReadSync() )
     
    668683    {
    669684      oldMask = mask;
     685      sentSomething = true;
    670686      SYNCHELP_WRITE_BYTE( DATA_flags, NWT_SS_B );
    671687      SYNCHELP_WRITE_BYTE( mask, NWT_SS_FLAGS );
     
    682698      SYNCHELP_WRITE_BYTE( DATA_mouse, NWT_SS_B );
    683699      PRINTF(0)("SENDING mousedir\n");
     700      sentSomething = true;
    684701      SYNCHELP_WRITE_FLOAT( mouseDir.w, NWT_SS_MOUSEDIRW );
    685702      SYNCHELP_WRITE_FLOAT( mouseDir.v.x, NWT_SS_MOUSEDIRX );
     
    693710    {
    694711      oldVelocity = velocity;
    695       PRINTF(0)("SENDING velocity\n");
    696       SYNCHELP_WRITE_BYTE( DATA_velocity, NWT_SS_B );
    697       SYNCHELP_WRITE_FLOAT( velocity.x, NWT_SS_VELX );
    698       SYNCHELP_WRITE_FLOAT( velocity.y, NWT_SS_VELY );
    699       SYNCHELP_WRITE_FLOAT( velocity.z, NWT_SS_VELZ );
     712      //PRINTF(0)("SENDING velocity\n");
     713      //SYNCHELP_WRITE_BYTE( DATA_velocity, NWT_SS_B );
     714      //SYNCHELP_WRITE_FLOAT( velocity.x, NWT_SS_VELX );
     715      //SYNCHELP_WRITE_FLOAT( velocity.y, NWT_SS_VELY );
     716      //SYNCHELP_WRITE_FLOAT( velocity.z, NWT_SS_VELZ );
    700717    }
    701718   
    702719    if ( Playable::needsReadSync() )
    703720    {
     721      sentSomething = true;
    704722      SYNCHELP_WRITE_BYTE( DATA_playables, NWT_SS_B );
    705723      SYNCHELP_WRITE_FKT( Playable::readSync, NWT_SS_PL_SYNC );
     
    707725
    708726  }
     727 
     728  if ( !sentSomething )
     729    reciever = 0;
    709730
    710731  return SYNCHELP_WRITE_N;
Note: See TracChangeset for help on using the changeset viewer.