Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6483 in orxonox.OLD


Ignore:
Timestamp:
Jan 11, 2006, 3:35:24 PM (18 years ago)
Author:
rennerc
Message:

base_object.cc: fixed bug with sync

Location:
branches/network/src
Files:
6 edited

Legend:

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

    r6469 r6483  
    10391039  SYNCHELP_READ_FKT( BaseObject::writeState );
    10401040
    1041   //PRINTF(0)("name = %s\n", this->getName());
    1042 
    10431041  char * parentName = NULL;
    10441042  SYNCHELP_READ_STRINGM( parentName );
     
    10651063  SYNCHELP_READ_FLOAT( f3 );
    10661064  this->setRelCoor( f1, f2, f3 );
    1067   //this->setRelCoor( 10, 0, 0 );
    1068 
    1069   SYNCHELP_READ_FLOAT( f1 );
     1065  //this->setRelCoor( 5, 0, 0 );
     1066
     1067  /*SYNCHELP_READ_FLOAT( f1 );
    10701068  SYNCHELP_READ_FLOAT( f2 );
    1071   SYNCHELP_READ_FLOAT( f3 );
     1069  SYNCHELP_READ_FLOAT( f3 );*/
    10721070  //this->setAbsCoor( f1, f2, f3 );
    10731071
     
    10781076  this->setRelDir( Quaternion( Vector(f2, f3, f4), f1 ) );
    10791077
    1080   SYNCHELP_READ_FLOAT( f1 );
     1078  /*SYNCHELP_READ_FLOAT( f1 );
    10811079  SYNCHELP_READ_FLOAT( f2 );
    10821080  SYNCHELP_READ_FLOAT( f3 );
    1083   SYNCHELP_READ_FLOAT( f4 );
     1081  SYNCHELP_READ_FLOAT( f4 );*/
    10841082  //this->setAbsDir( Quaternion( Vector(f2, f3, f4), f1 ) );
    10851083
     
    11131111  SYNCHELP_WRITE_FKT( BaseObject::readState );
    11141112
    1115   //PRINTF(0)("name = %s\n", this->getName());
    1116 
    11171113  if ( this->parent )
    11181114  {
     
    11321128  //PRINTF(0)("%s, %f, %f, %f\n", getClassName(), relCoordinate.x, relCoordinate.y, relCoordinate.z);
    11331129
    1134   SYNCHELP_WRITE_FLOAT( this->absCoordinate.x );
     1130  /*SYNCHELP_WRITE_FLOAT( this->absCoordinate.x );
    11351131  SYNCHELP_WRITE_FLOAT( this->absCoordinate.y );
    1136   SYNCHELP_WRITE_FLOAT( this->absCoordinate.z );
     1132  SYNCHELP_WRITE_FLOAT( this->absCoordinate.z );*/
    11371133
    11381134  //PRINTF(0)("%s, %f, %f, %f\n", getClassName(), absCoordinate.x, absCoordinate.y, absCoordinate.z);
     
    11431139  SYNCHELP_WRITE_FLOAT( this->relDirection.v.z );
    11441140
    1145   SYNCHELP_WRITE_FLOAT( this->absDirection.w );
     1141  /*SYNCHELP_WRITE_FLOAT( this->absDirection.w );
    11461142  SYNCHELP_WRITE_FLOAT( this->absDirection.v.x );
    11471143  SYNCHELP_WRITE_FLOAT( this->absDirection.v.y );
    1148   SYNCHELP_WRITE_FLOAT( this->absDirection.v.z );
     1144  SYNCHELP_WRITE_FLOAT( this->absDirection.v.z );*/
    11491145
    11501146  int n = children.size();
     
    11551151    SYNCHELP_WRITE_STRING( (*it)->getName() );
    11561152  }
     1153
    11571154  return SYNCHELP_WRITE_N;
    11581155}
  • branches/network/src/lib/lang/base_object.cc

    r6341 r6483  
    199199  }
    200200  SYNCHELP_READ_STRINGM( this->objectName );
     201  if ( this->objectName && !strcmp(this->objectName, "") )
     202  {
     203    delete[] this->objectName;
     204    this->objectName = NULL;
     205  }
    201206
    202207  return SYNCHELP_READ_N;
  • branches/network/src/lib/network/network_game_manager.cc

    r6469 r6483  
    164164    SYNCHELP_WRITE_BYTE( b );
    165165    hasRequestedWorld = true;
    166     PRINTF(0)("the world is enough! id=%d\n", this->getUniqueID());
    167166    return SYNCHELP_WRITE_N;
    168167  }
     
    462461    PRINTF(0)("Fabricated %s with id %d\n", s->getClassName(), s->getUniqueID());
    463462
    464     //NOTE: hack to prevent collision
     463    //HACK: hack to prevent collision
    465464    if ( b->isA(CL_WORLD_ENTITY) )
    466465    {
  • branches/network/src/lib/network/network_stream.cc

    r6469 r6483  
    166166      networkSockets[0]->destroy();
    167167      networkSockets[0] = NULL;
    168       //TODO: delete handshake from synchronizeable list so i can delete it
     168
    169169      if ( handshakes[0] )
    170170        delete handshakes[0];
     
    252252          if ( networkSockets[reciever] != NULL )
    253253          {
    254             PRINTF(0)("write %d bytes to socket %d\n", dataLength, reciever);
     254            PRINTF(5)("write %d bytes to socket %d\n", dataLength, reciever);
    255255            networkSockets[reciever]->writePacket(downBuffer, dataLength);
    256256          }
     
    266266            if ( networkSockets[i] != NULL )
    267267            {
    268               PRINTF(0)("write %d bytes to socket %d\n", dataLength, reciever);
     268              PRINTF(5)("write %d bytes to socket %d\n", dataLength, reciever);
    269269              networkSockets[i]->writePacket(downBuffer, dataLength);
    270270            }
     
    372372      networkSockets[i]->destroy();
    373373      networkSockets[i] = NULL;
    374       //TODO: delete handshake from synchronizeable list so i can delete it
     374
    375375      if ( handshakes[i] )
    376376        delete handshakes[i];
  • branches/network/src/world_entities/skybox.cc

    r6469 r6483  
    250250  if ( rec > 0 )
    251251  {
    252     PRINT(0)("SEND DATA: size=%f texture='%s'\n", size, textureName);
    253252    *reciever = rec;
    254253
  • branches/network/src/world_entities/space_ships/space_ship.cc

    r6469 r6483  
    574574    SYNCHELP_READ_FLOAT( xMouse );
    575575    SYNCHELP_READ_FLOAT( yMouse );
    576     SYNCHELP_READ_FLOAT( mouseSensitivity ); //TODO: remove this two lines
     576    SYNCHELP_READ_FLOAT( mouseSensitivity );
    577577    SYNCHELP_READ_FLOAT( cycle );
    578578  }
     
    609609  *reciever = 0;
    610610
    611   if ( this->getHostID()!=this->getOwner() )
     611  if ( this->getHostID()==this->getOwner() )
    612612  {
    613613    int mask = 0;
     
    630630      mask |= MASK_bRollR;
    631631
    632     static int oldMask = mask+1; //so it it different the first time!
     632    static int oldMask = mask+1; //so it is different the first time!
    633633    static float oldxMouse = xMouse + 1.0;
    634634    static float oldyMouse = yMouse + 1.0;
     
    649649      SYNCHELP_WRITE_FLOAT( yMouse );
    650650      SYNCHELP_WRITE_FLOAT( mouseSensitivity );
    651       SYNCHELP_WRITE_FLOAT( cycle );  //TODO: remove this two lines
     651      SYNCHELP_WRITE_FLOAT( cycle );
    652652    }
    653653  }
Note: See TracChangeset for help on using the changeset viewer.