Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7631 in orxonox.OLD for branches/network/src/subprojects


Ignore:
Timestamp:
May 17, 2006, 8:28:23 AM (18 years ago)
Author:
rennerc
Message:

synchronisation should work now

Location:
branches/network/src/subprojects/network
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/subprojects/network/network_unit_test.cc

    r7617 r7631  
    259259 
    260260  SimpleSync* ss = new SimpleSync("Server");
     261  ss->setSynchronized( true );
    261262
    262263 
     
    292293  netMan->establishConnection("localhost", 9999);
    293294 
    294   SimpleSync* ss = new SimpleSync("SimpleSync");
    295   netMan->connectSynchronizeable( *ss );
    296 
     295//  SimpleSync* ss = new SimpleSync("SimpleSync");
     296//  ss->setSynchronized( true );
     297//  netMan->connectSynchronizeable( *ss );
     298
     299  SimpleSync * ss = NULL;
     300 
    297301  for(;;)
    298302  {
    299303    netMan->synchronize();
     304    ss = dynamic_cast<SimpleSync*>(ClassList::getObject( "Server", CL_SIMPLE_SYNC ) );
    300305    SDL_Delay(1000);
    301     ss->debug();
     306    if (ss)
     307      ss->debug();
    302308  }
    303309
  • branches/network/src/subprojects/network/simple_sync.cc

    r7617 r7631  
    2222#include "simple_sync.h"
    2323
     24#include "class_id.h"
     25#include "fast_factory.h"
     26#include "lib/util/loading/factory.h"
     27
    2428#include "debug.h"
     29
     30CREATE_FACTORY(SimpleSync, CL_SIMPLE_SYNC);
    2531
    2632
     
    3137{
    3238  setName( name );
     39  this->setClassID( CL_SIMPLE_SYNC, "SimpleSync" );
    3340  in = 0;
    3441  out = 1;
     
    4956}
    5057
     58SimpleSync::SimpleSync( const TiXmlElement * root )
     59{
     60  setName( "" );
     61  this->setClassID( CL_SIMPLE_SYNC, "SimpleSync" );
     62  in = 0;
     63  out = 1;
     64  id = this->registerVarId( new SynchronizeableInt( &in, &out, "var", PERMISSION_ALL ) );
     65}
    5166
    5267
     68
  • branches/network/src/subprojects/network/simple_sync.h

    r7617 r7631  
    1414  public:
    1515    SimpleSync( std::string name);
     16    SimpleSync(const TiXmlElement* root = NULL);
    1617    virtual ~SimpleSync();
    1718   
Note: See TracChangeset for help on using the changeset viewer.