Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6994 in orxonox.OLD


Ignore:
Timestamp:
Feb 2, 2006, 11:57:54 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the Network branche back here

Location:
trunk/src
Files:
6 edited

Legend:

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

    r6985 r6994  
    539539    PRINTF(0)("Fabricated %s with id %d\n", s->getClassName(), s->getUniqueID());
    540540
    541     //HACK: hack to prevent collision
     541    //TODO HACK: hack to prevent collision
    542542    if ( b->isA(CL_WORLD_ENTITY) && !b->isA(CL_PLAYABLE) )
    543543    {
     
    551551      }
    552552    }
    553     ///HACK this is only for network multiplayer games.
     553    ///TODO HACK this is only for network multiplayer games.
    554554    if( b->isA(CL_SPACE_SHIP))
    555555    {
  • trunk/src/lib/network/network_socket.cc

    r6959 r6994  
    444444  if (blen>maxLength)
    445445  {
    446     PRINTF(1)("Buffersize is too small (%d) for packet (%d)\n", maxLength, blen);
     446    PRINTF(1)("Buffersize is too small (%d) for packet (%d).\n", maxLength, blen);
    447447    assert(false);
    448448    return 0;
  • trunk/src/lib/network/network_socket.h

    r6981 r6994  
    88#define _NETWORK_SOCKET
    99
    10 //HACK else gdb will not work on server
     10//TODO HACK else gdb will not work on server
    1111#define DONTEXITTHREADS
    1212
  • trunk/src/world_entities/playable.cc

    r6987 r6994  
    305305{
    306306  SYNCHELP_READ_BEGIN();
    307 
     307 
     308  byte b;
     309  SYNCHELP_READ_BYTE( b, NWT_PL_B );
     310 
    308311  byte flags;
    309 
    310   SYNCHELP_READ_BYTE( flags, NWT_PL_FLAGS );
    311 
    312   bFire = (flags & FLAGS_bFire) != 0;
     312 
     313  if ( b == DATA_FLAGS )
     314  {
     315    SYNCHELP_READ_BYTE( flags, NWT_PL_FLAGS );
     316
     317    bFire = (flags & FLAGS_bFire) != 0;
     318   
     319    return SYNCHELP_READ_N;
     320  }
     321 
     322  if ( b == DATA_SCORE )
     323  {
     324    int newScore;
     325    SYNCHELP_READ_BYTE( newScore, NWT_PL_SCORE );
     326    setScore( newScore );
     327   
     328    return SYNCHELP_READ_N;
     329  }
    313330
    314331  return SYNCHELP_READ_N;
     
    318335{
    319336  SYNCHELP_WRITE_BEGIN();
     337 
     338  if ( score != oldScore && isServer() )
     339  {
     340    SYNCHELP_WRITE_BYTE( DATA_SCORE, NWT_PL_B);
     341    SYNCHELP_WRITE_INT( score, NWT_PL_SCORE );
     342    oldScore = score;
     343   
     344    return SYNCHELP_WRITE_N;
     345  }
     346 
    320347  byte flags = 0;
    321348
     
    324351
    325352
     353  SYNCHELP_WRITE_BYTE( DATA_FLAGS, NWT_PL_B);
    326354  SYNCHELP_WRITE_BYTE( flags, NWT_PL_FLAGS );
    327355  oldFlags = flags;
     
    333361bool Playable::needsReadSync( )
    334362{
    335   //if ( score != oldScore )
    336   //  return true;
     363  if ( score != oldScore && isServer() )
     364    return true;
    337365
    338366  byte flags = 0;
  • trunk/src/world_entities/playable.h

    r6986 r6994  
    8484    int                   oldScore;
    8585
    86     //HACK: explosion emitter
     86    //TODO HACK: explosion emitter
    8787    DotEmitter*           emitter;
    8888    SpriteParticles*      explosionParticles;
  • trunk/src/world_entities/space_ships/space_ship.cc

    r6986 r6994  
    9797  {
    9898    //this->loadModel("models/ships/reap_#.obj");
    99     ///HACK this is only for network multiplayer games.
     99    //TODO HACK this is only for network multiplayer games.
    100100    if( this->getOwner()%2 == 0)
    101101    {
     
    762762    }
    763763
    764     if ( Playable::needsReadSync() )
     764    while ( Playable::needsReadSync() )
    765765    {
    766766      sentSomething = true;
Note: See TracChangeset for help on using the changeset viewer.