Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7153


Ignore:
Timestamp:
Jul 12, 2010, 1:08:58 PM (14 years ago)
Author:
scheusso
Message:
  • merged network2 branch into presentation3 branch (lots of network traffic and cpu load improvements)
  • fixed network related bugs in BigExplosion
Location:
code/branches/presentation3
Files:
52 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation3

  • code/branches/presentation3/src/libraries/network/GamestateClient.cc

    r6417 r7153  
    161161      assert(b);
    162162    }
    163     if(gs->isDiffed()){
    164       packet::Gamestate *base = gamestateMap_[gs->getBaseID()];
    165       if(!base){
    166         COUT(3) << "could not find base gamestate id: " << gs->getBaseID() << endl;
    167         delete gs;
    168         return 0;
    169       }
    170 //       assert(base); //TODO: fix this
    171       packet::Gamestate *undiffed = gs->undiff(base);
    172       delete gs;
    173       gs=undiffed;
    174       COUT(5) << "successfully undiffed gamestate id: " << undiffed->getID() << std::endl;
     163    if(gs->isDiffed())
     164    {
     165      assert(0);
     166//       packet::Gamestate *base = gamestateMap_[gs->getBaseID()];
     167//       if(!base)
     168//       {
     169//         COUT(0) << "could not find base gamestate id: " << gs->getBaseID() << endl;
     170//         assert(0);
     171//         delete gs;
     172//         return 0;
     173//       }
     174//       packet::Gamestate *undiffed = gs->undiff(base);
     175//       delete gs;
     176//       gs=undiffed;
     177//       COUT(5) << "successfully undiffed gamestate id: " << undiffed->getID() << std::endl;
    175178    }
    176179    if(gs->spreadData(0x2))
     
    178181    else
    179182    {
    180       COUT(3) << "could not spread gamestate" << endl;
     183      COUT(0) << "could not spread gamestate" << endl;
     184      assert(0);
    181185      return NULL;
    182186    }
  • code/branches/presentation3/src/libraries/network/GamestateManager.cc

    r6417 r7153  
    4343#include <cassert>
    4444#include <queue>
     45#include "util/Clock.h"
    4546// #include <boost/thread/mutex.hpp>
    4647
     
    158159
    159160      clientGamestates.push(0);
    160       finishGamestate( cid, &clientGamestates.back(), client, reference );
     161      finishGamestate( cid, clientGamestates.back(), client, reference );
    161162      //FunctorMember<GamestateManager>* functor =
    162163//       ExecutorMember<GamestateManager>* executor = createExecutor( createFunctor(&GamestateManager::finishGamestate, this) );
     
    180181
    181182
    182   void GamestateManager::finishGamestate( unsigned int clientID, packet::Gamestate** destgamestate, packet::Gamestate* base, packet::Gamestate* gamestate ) {
     183  void GamestateManager::finishGamestate( unsigned int clientID, packet::Gamestate*& destgamestate, packet::Gamestate* base, packet::Gamestate* gamestate ) {
    183184    //why are we searching the same client's gamestate id as we searched in
    184185    //Server::sendGameState?
     
    186187    //chose wheather the next gamestate is the first or not
    187188
    188     packet::Gamestate *gs = gamestate->doSelection(clientID, 20000);
    189 //     packet::Gamestate *gs = new packet::Gamestate(*gamestate);
     189//     packet::Gamestate *gs = gamestate->doSelection(clientID, 20000);
     190//       packet::Gamestate* gs = new packet::Gamestate(*gamestate);
     191//     packet::Gamestate* gs = gamestate;
     192    packet::Gamestate *gs = new packet::Gamestate(*gamestate); //TODO: is this neccessary ?
    190193//     packet::Gamestate *gs = new packet::Gamestate();
    191194//     gs->collectData( id_, 0x1 );
     
    193196    gamestateMap_[clientID][gamestate->getID()]=gs;
    194197//     this->threadMutex_->unlock();
     198      Clock clock;
     199      clock.capture();
    195200
    196201    if(base)
    197202    {
    198 
    199 //       COUT(3) << "diffing" << std::endl;
    200 //       packet::Gamestate* gs1  = gs;
    201       packet::Gamestate *diffed = gs->diff(base);
    202       //packet::Gamestate *gs2 = diffed->undiff(gs);
    203 //       assert(*gs == *gs2);
    204       gs = diffed;
    205 //       packet::Gamestate* gs2 = gs->undiff(client);
    206 //       gs = new packet::Gamestate(*gs);
    207 //       assert(*gs1==*gs2);
    208     }
    209     else{
     203      packet::Gamestate *diffed1 = gs->diffVariables(base);
     204      if( diffed1->getDataSize() == 0 )
     205      {
     206        delete diffed1;
     207        destgamestate = 0;
     208        return;
     209      }
     210      gs = diffed1;
     211    }
     212    else
     213    {
    210214      gs = new packet::Gamestate(*gs);
    211215    }
     
    214218    bool b = gs->compressData();
    215219    assert(b);
    216 //     COUT(4) << "sending gamestate with id " << gs->getID();
     220      clock.capture();
     221      COUT(0) << "diff time: " << clock.getDeltaTime() << endl;
     222//     COUT(5) << "sending gamestate with id " << gs->getID();
    217223//     if(gamestate->isDiffed())
    218 //     COUT(4) << " and baseid " << gs->getBaseID() << endl;
     224//       COUT(5) << " and baseid " << gs->getBaseID() << endl;
    219225//     else
    220 //     COUT(4) << endl;
     226//       COUT(5) << endl;
    221227    gs->setClientID(clientID);
    222     *destgamestate = gs;
     228    destgamestate = gs;
    223229  }
    224230
  • code/branches/presentation3/src/libraries/network/GamestateManager.h

    r5781 r7153  
    7676    void sendGamestates();
    7777//     packet::Gamestate *popGameState(unsigned int clientID);
    78     void finishGamestate( unsigned int clientID, packet::Gamestate** destgamestate, packet::Gamestate* base, packet::Gamestate* gamestate );
     78    void finishGamestate( unsigned int clientID, packet::Gamestate*& destgamestate, packet::Gamestate* base, packet::Gamestate* gamestate );
    7979
    8080    bool getSnapshot();
  • code/branches/presentation3/src/libraries/network/Host.h

    r6928 r7153  
    3636
    3737  const unsigned int CLIENTID_SERVER = 0;
    38   const unsigned int NETWORK_FREQUENCY = 30;
     38  const unsigned int NETWORK_FREQUENCY = 25;
    3939  const float NETWORK_PERIOD = 1.0f/NETWORK_FREQUENCY;
    4040
  • code/branches/presentation3/src/libraries/network/packet/Gamestate.cc

    r6417 r7153  
    4545#define PACKET_FLAG_GAMESTATE  PacketFlag::Reliable
    4646
    47 
    48 Gamestate::Gamestate()
     47inline bool memzero( uint8_t* data, uint32_t datalength)
     48{
     49  uint64_t* d = (uint64_t*)data;
     50
     51  for( unsigned int i=0; i<datalength/8; i++ )
     52  {
     53    if( *(d+i) != 0 )
     54      return false;
     55  }
     56  // now process the rest (when datalength isn't a multiple of 4)
     57  for( unsigned int j = 8*(datalength/8); j<datalength; j++ )
     58  {
     59    if( *(data+j) != 0 )
     60      return false;
     61  }
     62  return true;
     63}
     64
     65
     66Gamestate::Gamestate():
     67  header_(0)
    4968{
    5069  flags_ = flags_ | PACKET_FLAG_GAMESTATE;
    51   header_ = 0;
    52 }
     70}
     71
    5372
    5473Gamestate::Gamestate(uint8_t *data, unsigned int clientID):
    55     Packet(data, clientID)
     74  Packet(data, clientID)
    5675{
    5776  flags_ = flags_ | PACKET_FLAG_GAMESTATE;
     
    5978}
    6079
     80
    6181Gamestate::Gamestate(uint8_t *data)
    6282{
    6383  flags_ = flags_ | PACKET_FLAG_GAMESTATE;
    64   data_=data;
     84  data_ = data;
    6585  header_ = new GamestateHeader(data_);
    6686}
    6787
     88
    6889Gamestate::Gamestate(const Gamestate& g) :
    69     Packet( *(Packet*)&g )
     90    Packet( *(Packet*)&g ), nrOfVariables_(0)
    7091{
    7192  flags_ = flags_ | PACKET_FLAG_GAMESTATE;
    7293  header_ = new GamestateHeader(data_);
     94  sizes_ = g.sizes_;
    7395}
    7496
     
    79101    delete header_;
    80102}
     103
    81104
    82105bool Gamestate::collectData(int id, uint8_t mode)
     
    91114    return false;
    92115  data_ = new uint8_t[size + GamestateHeader::getSize()];
    93   if(!data_){
     116  if(!data_)
     117  {
    94118    COUT(2) << "GameStateManager: could not allocate memory" << std::endl;
    95119    return false;
     
    101125
    102126  //start collect data synchronisable by synchronisable
    103   uint8_t *mem=data_;
     127  uint8_t *mem = data_; // in this stream store all data of the variables and the headers of the synchronisable
    104128  mem += GamestateHeader::getSize();
    105129  ObjectList<Synchronisable>::iterator it;
    106   for(it = ObjectList<Synchronisable>::begin(); it; ++it){
     130  for(it = ObjectList<Synchronisable>::begin(); it; ++it)
     131  {
    107132
    108133//     tempsize=it->getSize(id, mode);
    109134
    110     tempsize = it->getData(mem, id, mode);
     135    tempsize = it->getData(mem, this->sizes_, id, mode);
    111136    if ( tempsize != 0 )
    112137      dataVector_.push_back( obj(it->getObjectID(), it->getCreatorID(), tempsize, mem-data_) );
    113138
    114139#ifndef NDEBUG
    115     if(currentsize+tempsize > size){
     140    if(currentsize+tempsize > size)
     141    {
    116142      assert(0); // if we don't use multithreading this part shouldn't be neccessary
    117143      // start allocate additional memory
     
    148174}
    149175
     176
    150177bool Gamestate::spreadData(uint8_t mode)
    151178{
     
    153180  assert(data_);
    154181  assert(!header_->isCompressed());
    155   assert(!header_->isDiffed());
    156182  uint8_t *mem=data_+GamestateHeader::getSize();
    157183  Synchronisable *s;
    158184
    159185  // update the data of the objects we received
    160   while(mem < data_+GamestateHeader::getSize()+header_->getDataSize()){
     186  while(mem < data_+GamestateHeader::getSize()+header_->getDataSize())
     187  {
    161188    SynchronisableHeader objectheader(mem);
    162189
     
    170197      else
    171198      {
    172         mem += objectheader.getDataSize();
     199        mem += objectheader.getDataSize() + ( objectheader.isDiffed() ? SynchronisableHeaderLight::getSize() : SynchronisableHeader::getSize() );
    173200      }
    174201    }
     
    181208   // In debug mode, check first, whether there are no duplicate objectIDs
    182209#ifndef NDEBUG
    183   if(this->getID()%1000==0){
     210  if(this->getID()%1000==1)
     211  {
    184212    std::list<uint32_t> v1;
    185213    ObjectList<Synchronisable>::iterator it;
    186     for (it = ObjectList<Synchronisable>::begin(); it != ObjectList<Synchronisable>::end(); ++it) {
    187       if (it->getObjectID() == OBJECTID_UNKNOWN) {
    188         if (it->objectMode_ != 0x0) {
     214    for (it = ObjectList<Synchronisable>::begin(); it != ObjectList<Synchronisable>::end(); ++it)
     215    {
     216      if (it->getObjectID() == OBJECTID_UNKNOWN)
     217      {
     218        if (it->objectMode_ != 0x0)
     219        {
    189220          COUT(0) << "Found object with OBJECTID_UNKNOWN on the client with objectMode != 0x0!" << std::endl;
    190221          COUT(0) << "Possible reason for this error: Client created a synchronized object without the Server's approval." << std::endl;
     
    193224        }
    194225      }
    195       else {
     226      else
     227      {
    196228        std::list<uint32_t>::iterator it2;
    197         for (it2 = v1.begin(); it2 != v1.end(); ++it2) {
    198           if (it->getObjectID() == *it2) {
     229        for (it2 = v1.begin(); it2 != v1.end(); ++it2)
     230        {
     231          if (it->getObjectID() == *it2)
     232          {
    199233            COUT(0) << "Found duplicate objectIDs on the client!" << std::endl
    200234                    << "Are you sure you don't create a Sychnronisable objcect with 'new' \
     
    211245}
    212246
     247
    213248uint32_t Gamestate::getSize() const
    214249{
     
    222257}
    223258
    224 bool Gamestate::operator==(packet::Gamestate gs){
     259
     260bool Gamestate::operator==(packet::Gamestate gs)
     261{
    225262  uint8_t *d1 = data_+GamestateHeader::getSize();
    226263  uint8_t *d2 = gs.data_+GamestateHeader::getSize();
     
    233270}
    234271
     272
    235273bool Gamestate::process()
    236274{
    237275  return GamestateHandler::addGamestate(this, getClientID());
    238276}
    239 
    240277
    241278
     
    253290  int retval;
    254291  retval = compress( dest, &buffer, source, (uLong)(header_->getDataSize()) );
    255   switch ( retval ) {
     292  switch ( retval )
     293  {
    256294    case Z_OK: COUT(5) << "G.St.Man: compress: successfully compressed" << std::endl; break;
    257295    case Z_MEM_ERROR: COUT(1) << "G.St.Man: compress: not enough memory available in gamestate.compress" << std::endl; return false;
     
    270308  header_->setCompSize( buffer );
    271309  header_->setCompressed( true );
    272   COUT(5) << "gamestate compress datasize: " << header_->getDataSize() << " compsize: " << header_->getCompSize() << std::endl;
     310  COUT(0) << "gamestate compress datasize: " << header_->getDataSize() << " compsize: " << header_->getCompSize() << std::endl;
    273311  return true;
    274312}
     313
     314
    275315bool Gamestate::decompressData()
    276316{
     
    289329  uLongf length=bufsize;
    290330  retval = uncompress( dest, &length, source, (uLong)compsize );
    291   switch ( retval ) {
     331  switch ( retval )
     332  {
    292333    case Z_OK: COUT(5) << "successfully decompressed" << std::endl; break;
    293334    case Z_MEM_ERROR: COUT(1) << "not enough memory available" << std::endl; return false;
     
    301342  delete temp;
    302343
    303   if (this->bDataENetAllocated_){
     344  if (this->bDataENetAllocated_)
     345  {
    304346    // Memory was allocated by ENet. --> We let it be since enet_packet_destroy will
    305347    // deallocated it anyway. So data and packet stay together.
    306348    this->bDataENetAllocated_ = false;
    307349  }
    308   else{
     350  else
     351  {
    309352    // We allocated the memory in the first place (unlikely). So we destroy the old data
    310353    // and overwrite it with the new decompressed data.
     
    320363}
    321364
    322 /*Gamestate *Gamestate::diff(Gamestate *base)
    323 {
    324   assert(data_);
    325   assert(!header_->isCompressed());
     365
     366Gamestate* Gamestate::diffVariables(Gamestate *base)
     367{
     368  assert(this && base); assert(data_ && base->data_);
     369  assert(!header_->isCompressed() && !base->header_->isCompressed());
    326370  assert(!header_->isDiffed());
    327   GamestateHeader diffHeader(base->data_);
    328   uint8_t *basep = GAMESTATE_START(base->data_), *gs = GAMESTATE_START(this->data_);
    329   uint32_t of=0; // pointers offset
    330   uint32_t dest_length=0;
    331   dest_length=header_->getDataSize();
    332   if(dest_length==0)
    333     return NULL;
    334   uint8_t *ndata = new uint8_t[dest_length*sizeof(uint8_t)+GamestateHeader::getSize()];
    335   uint8_t *dest = ndata + GamestateHeader::getSize();
    336   while(of < diffHeader.getDataSize() && of < header_->getDataSize()){
    337     *(dest+of)=*(basep+of)^*(gs+of); // do the xor
    338     ++of;
    339   }
    340   if(diffHeader.getDataSize()!=header_->getDataSize()){
    341     uint8_t n=0;
    342     if(diffHeader.getDataSize() < header_->getDataSize()){
    343       while(of<dest_length){
    344         *(dest+of)=n^*(gs+of);
    345         of++;
    346       }
    347     }
    348   }
    349 
    350   Gamestate *g = new Gamestate(ndata, getClientID());
     371
     372
     373  // *** first do a raw diff of the two gamestates
     374
     375  uint8_t *baseData = GAMESTATE_START(base->data_);
     376  uint8_t *origData = GAMESTATE_START(this->data_);
     377  uint32_t origLength = header_->getDataSize();
     378  uint32_t baseLength = base->header_->getDataSize();
     379
     380  assert( origLength && baseLength );
     381
     382  uint8_t *nData = new uint8_t[origLength + GamestateHeader::getSize() + sizeof(uint32_t)*this->nrOfVariables_]; // this is the maximum size needed in the worst case
     383  uint8_t *dest = GAMESTATE_START(nData);
     384
     385  uint32_t baseOffset = 0; //offset in the diffed stream
     386  uint32_t origOffset = 0; //offset in the new stream with removed 0's
     387  std::vector<uint32_t>::iterator sizes = this->sizes_.begin();
     388
     389  while( origOffset < origLength )
     390  {
     391    //iterate through all objects
     392
     393    SynchronisableHeader h(origData+origOffset);
     394
     395    // Find (if possible) the current object in the datastream of the old gamestate
     396    // Start at the current offset position
     397    if(baseOffset >= baseLength)
     398      baseOffset = 0;
     399    uint8_t* temp = baseData + baseOffset;
     400    uint32_t objectID = h.getObjectID();
     401    assert(temp < baseData+baseLength);
     402    assert(dest < nData + origLength + GamestateHeader::getSize() + sizeof(uint32_t)*this->nrOfVariables_);
     403    assert(sizes != this->sizes_.end());
     404    while ( temp < baseData+baseLength )
     405    {
     406      SynchronisableHeader htemp(temp);
     407      if ( htemp.getObjectID() == objectID )
     408      {
     409        assert( h.getClassID() == htemp.getClassID() );
     410        goto DODIFF;
     411      }
     412      temp += htemp.getDataSize()+SynchronisableHeader::getSize();
     413    }
     414    // If not found start looking at the beginning
     415    temp = baseData;
     416    while ( temp < baseData+baseOffset )
     417    {
     418      SynchronisableHeader htemp(temp);
     419      if ( htemp.getObjectID() == objectID )
     420      {
     421        assert( h.getClassID() == htemp.getClassID() );
     422        goto DODIFF;
     423      }
     424      temp += htemp.getDataSize()+SynchronisableHeader::getSize();
     425    }
     426    // Object is new, thus never transmitted -> just copy over
     427    goto DOCOPY;
     428
     429
     430DODIFF:
     431    {
     432//       if(baseOffset==0)
     433//       {
     434//         assert(origOffset==0);
     435//       }
     436      uint32_t objectOffset = SynchronisableHeader::getSize(); // offset inside the object in the origData and baseData
     437      // Check whether the whole object stayed the same
     438      if( memcmp( origData+origOffset+objectOffset, temp+objectOffset, h.getDataSize()) == 0 )
     439      {
     440        origOffset += objectOffset+ h.getDataSize(); // skip the whole object
     441        baseOffset = temp + h.getDataSize()+SynchronisableHeader::getSize() - baseData;
     442        sizes += Synchronisable::getSynchronisable(h.getObjectID())->getNrOfVariables();
     443      }
     444      else
     445      {
     446//         COUT(4) << "diff " << h.getObjectID() << ":";
     447        // Now start to diff the Object
     448        SynchronisableHeaderLight h2(dest);
     449        h2 = h; // copy over the objectheader
     450        VariableID variableID = 0;
     451        uint32_t newObjectOffset = SynchronisableHeaderLight::getSize();
     452        // iterate through all variables
     453        while( objectOffset < h.getDataSize()+SynchronisableHeader::getSize() )
     454        {
     455          // check whether variable changed and write id and copy over variable to the new stream
     456          // otherwise skip variable
     457          assert(sizes != this->sizes_.end());
     458          uint32_t varSize = *sizes;
     459          assert( varSize == Synchronisable::getSynchronisable(h.getObjectID())->getVarSize(variableID) );
     460          if ( varSize != 0 )
     461          {
     462            if ( memcmp(origData+origOffset+objectOffset, temp+objectOffset, varSize) != 0 )
     463            {
     464//               COUT(4) << " c" << varSize;
     465              *(VariableID*)(dest+newObjectOffset) = variableID; // copy over the variableID
     466              newObjectOffset += sizeof(VariableID);
     467              memcpy( dest+newObjectOffset, origData+origOffset+objectOffset, varSize );
     468              newObjectOffset += varSize;
     469              objectOffset += varSize;
     470            }
     471            else
     472            {
     473//               COUT(4) << " s" << varSize;
     474              objectOffset += varSize;
     475            }
     476          }
     477
     478          ++variableID;
     479          ++sizes;
     480        }
     481        if( Synchronisable::getSynchronisable(h.getObjectID())->getNrOfVariables() != variableID )
     482          sizes += Synchronisable::getSynchronisable(h.getObjectID())->getNrOfVariables() - variableID;
     483//         COUT(4) << endl;
     484        h2.setDiffed(true);
     485        h2.setDataSize(newObjectOffset-SynchronisableHeaderLight::getSize());
     486        assert(objectOffset == h.getDataSize()+SynchronisableHeader::getSize());
     487        origOffset += objectOffset;
     488        baseOffset += temp + h.getDataSize()+SynchronisableHeader::getSize() - baseData;
     489        dest += newObjectOffset;
     490      }
     491
     492      continue;
     493    }
     494
     495DOCOPY:
     496    {
     497      // Just copy over the whole Object
     498      memcpy( dest, origData+origOffset, h.getDataSize()+SynchronisableHeader::getSize() );
     499      dest += h.getDataSize()+SynchronisableHeader::getSize();
     500      origOffset += h.getDataSize()+SynchronisableHeader::getSize();
     501      assert( Synchronisable::getSynchronisable(h.getObjectID()) );
     502//       COUT(4) << "copy " << h.getObjectID() << endl;
     503//       COUT(4) << "copy " << h.getObjectID() << ":";
     504      //sizes += Synchronisable::getSynchronisable(h.getObjectID())->getNrOfVariables();
     505      for( unsigned int i = 0; i < Synchronisable::getSynchronisable(h.getObjectID())->getNrOfVariables(); ++i )
     506      {
     507//         COUT(4) << " " << *sizes;
     508        ++sizes;
     509      }
     510//       COUT(4) << endl;
     511      assert(sizes != this->sizes_.end() || origOffset>=origLength);
     512      continue;
     513    }
     514  }
     515
     516
     517  Gamestate *g = new Gamestate(nData, getClientID());
     518  assert(g->header_);
    351519  *(g->header_) = *header_;
    352   g->header_->setDiffed( true );
    353520  g->header_->setBaseID( base->getID() );
     521  g->header_->setDataSize(dest - nData - GamestateHeader::getSize());
    354522  g->flags_=flags_;
    355523  g->packetDirection_ = packetDirection_;
     524  assert(!g->isCompressed());
    356525  return g;
    357 }*/
    358 
    359 Gamestate *Gamestate::diff(Gamestate *base)
     526}
     527
     528
     529Gamestate* Gamestate::diffData(Gamestate *base)
    360530{
    361531  assert(this && base); assert(data_ && base->data_);
     
    393563}
    394564
    395 Gamestate *Gamestate::undiff(Gamestate *base)
     565
     566Gamestate* Gamestate::undiff(Gamestate *base)
    396567{
    397568  assert(this && base); assert(data_ && base->data_);
     
    423594
    424595
    425 // Gamestate *Gamestate::diff(Gamestate *base)
    426 // {
    427 //   assert(data_);
    428 //   assert(!header_->isCompressed());
    429 //   assert(!header_->isDiffed());
    430 //   GamestateHeader diffHeader(base->data_);
    431 //   uint8_t *basep = GAMESTATE_START(base->data_), *gs = GAMESTATE_START(this->data_);
    432 //   uint32_t of=0; // pointers offset
    433 //   uint32_t dest_length=0;
    434 //   dest_length=header_->getDataSize();
    435 //   if(dest_length==0)
    436 //     return NULL;
    437 //   uint8_t *ndata = new uint8_t[dest_length*sizeof(uint8_t)+GamestateHeader::getSize()];
    438 //   uint8_t *dest = ndata + GamestateHeader::getSize();
    439 //
    440 //
    441 //   // LOOP-UNROLLED DIFFING
    442 //   uint32_t *dest32 = (uint32_t*)dest, *base32 = (uint32_t*)basep, *gs32 = (uint32_t*)gs;
    443 //   // diff in 4-byte steps
    444 //   while( of < (uint32_t)(header_->getDataSize())/4 ){
    445 //     if( of < (uint32_t)(diffHeader.getDataSize())/4 )
    446 //     {
    447 //       *(dest32+of)=*(base32+of) ^ *(gs32+of); // do the xor
    448 //       ++of;
    449 //     }
    450 //     else
    451 //     {
    452 //       *(dest32+of)=*(gs32+of); // same as 0 ^ *(gs32+of)
    453 //       ++of;
    454 //     }
    455 //   }
    456 //   for( unsigned int of2 = 0; of2 < header_->getDataSize()%4; ++of2 )
    457 //   {
    458 //     if( of*4+of2 < diffHeader.getDataSize() )
    459 //     {
    460 //       *(dest+4*of+of2)=*(basep+4*of+of2) ^ *(gs+4*of+of2); // do the xor
    461 //     }
    462 //     else
    463 //     {
    464 //       *(dest+4*of+of2)=*(gs+4*of+of2); // same as 0 ^ *(gs32+of)
    465 //     }
    466 //   }
    467 //
    468 //   Gamestate *g = new Gamestate(ndata, getClientID());
    469 //   *(g->header_) = *header_;
    470 //   g->header_->setDiffed( true );
    471 //   g->header_->setBaseID( base->getID() );
    472 //   g->flags_=flags_;
    473 //   g->packetDirection_ = packetDirection_;
    474 //   return g;
    475 // }
    476 
    477 
    478596void Gamestate::rawDiff( uint8_t* newdata, uint8_t* data, uint8_t* basedata, uint32_t datalength, uint32_t baselength)
    479597{
     
    501619  assert(j==datalength);
    502620}
     621
    503622
    504623Gamestate* Gamestate::doSelection(unsigned int clientID, unsigned int targetSize){
     
    529648//   COUT(0) << "myvector contains:";
    530649//   for ( itt=dataVector_.begin() ; itt!=dataVector_.end(); itt++ )
    531 //     COUT(0) << ' ' << (*itt).objID;
     650//     COUT(0) << " " << (*itt).objID;
    532651//   COUT(0) << endl;
    533652  for(it=dataVector_.begin(); it!=dataVector_.end();){
    534653    SynchronisableHeader oldobjectheader(origdata);
    535654    SynchronisableHeader newobjectheader(newdata);
    536     if ( it->objSize == 0 )
     655    if ( (*it).objSize == 0 )
    537656    {
    538657      ++it;
    539658      continue;
    540659    }
    541     objectsize = oldobjectheader.getDataSize();
     660    objectsize = oldobjectheader.getDataSize()+SynchronisableHeader::getSize();
    542661    objectOffset=SynchronisableHeader::getSize(); //skip the size and the availableData variables in the objectheader
    543     if ( it->objID == oldobjectheader.getObjectID() ){
     662    if ( (*it).objID == oldobjectheader.getObjectID() ){
    544663      memcpy(newdata, origdata, objectsize);
    545       assert(newobjectheader.isDataAvailable()==true);
    546664      ++it;
    547665    }else{
    548666      newobjectheader = oldobjectheader;
    549       newobjectheader.setDataAvailable(false);
    550667      memset(newdata+objectOffset, 0, objectsize-objectOffset);
    551668    }
     
    559676  {
    560677    SynchronisableHeader oldobjectheader(origdata);
    561     objectsize = oldobjectheader.getDataSize();
     678    objectsize = oldobjectheader.getDataSize()+SynchronisableHeader::getSize();
    562679    origdata += objectsize;
    563680    origsize += objectsize;
     
    571688
    572689
    573 /*Gamestate *Gamestate::undiff(Gamestate *base)
    574 {
    575   assert(this && base);assert(data_);
    576   assert(header_->isDiffed());
    577   assert(!header_->isCompressed() && !base->header_->isCompressed());
    578   uint8_t *basep = GAMESTATE_START(base->data_);
    579   uint8_t *gs = GAMESTATE_START(this->data_);
    580   uint32_t of=0; // pointers offset
    581   uint32_t dest_length=0;
    582   dest_length=header_->getDataSize();
    583   if(dest_length==0)
    584     return NULL;
    585   uint8_t *ndata = new uint8_t[dest_length*sizeof(uint8_t)+GamestateHeader::getSize()];
    586   uint8_t *dest = ndata + GamestateHeader::getSize();
    587   while(of < base->header_->getDataSize() && of < header_->getDataSize()){
    588     *(dest+of)=*(basep+of)^*(gs+of); // do the xor
    589     ++of;
    590   }
    591   if(base->header_->getDataSize()!=header_->getDataSize()){
    592     uint8_t n=0;
    593     if(base->header_->getDataSize() < header_->getDataSize()){
    594       while(of < dest_length){
    595         *(dest+of)=n^*(gs+of);
    596         of++;
    597       }
    598     }
    599   }
    600   Gamestate *g = new Gamestate(ndata, getClientID());
    601   assert(g->header_);
    602   *(g->header_) = *header_;
    603   g->header_->setDiffed( false );
    604   g->flags_=flags_;
    605   g->packetDirection_ = packetDirection_;
    606   assert(!g->isDiffed());
    607   assert(!g->isCompressed());
    608   return g;
    609 }*/
    610 
    611690uint32_t Gamestate::calcGamestateSize(int32_t id, uint8_t mode)
    612691{
    613   uint32_t size=0;
     692  uint32_t size = 0;
     693  uint32_t nrOfVariables = 0;
    614694    // get the start of the Synchronisable list
    615695  ObjectList<Synchronisable>::iterator it;
    616696    // get total size of gamestate
    617   for(it = ObjectList<Synchronisable>::begin(); it; ++it)
     697  for(it = ObjectList<Synchronisable>::begin(); it; ++it){
    618698    size+=it->getSize(id, mode); // size of the actual data of the synchronisable
     699    nrOfVariables += it->getNrOfVariables();
     700  }
     701//   COUT(0) << "allocating " << nrOfVariables << " ints" << endl;
     702  this->sizes_.reserve(nrOfVariables);
    619703  return size;
    620704}
     705
    621706
    622707} //namespace packet
  • code/branches/presentation3/src/libraries/network/packet/Gamestate.h

    r6073 r7153  
    3636#include <cstring>
    3737#include <list>
     38#include <vector>
    3839
    3940#include "util/CRC32.h"
     
    113114    inline bool isCompressed() const { return header_->isCompressed(); }
    114115    inline int32_t getBaseID() const { return header_->getBaseID(); }
    115     Gamestate *diff(Gamestate *base);
     116    inline uint32_t getDataSize() const { return header_->getDataSize(); }
     117    Gamestate* diffVariables(Gamestate *base);
     118    Gamestate* diffData(Gamestate *base);
    116119    Gamestate *undiff(Gamestate *base);
    117120    Gamestate* doSelection(unsigned int clientID, unsigned int targetSize);
     
    123126  private:
    124127    void rawDiff( uint8_t* newdata, uint8_t* data, uint8_t* basedata, uint32_t datalength, uint32_t baselength);
     128    inline uint32_t findObject( const SynchronisableHeader& header, uint8_t* mem, uint32_t dataLength, uint32_t startPosition = 0 );
    125129    virtual uint32_t getSize() const;
    126130    virtual inline bool process();
    127 
    128   private:
    129131    uint32_t calcGamestateSize(int32_t id, uint8_t mode=0x0);
    130     std::list<obj> dataVector_;
    131     GamestateHeader* header_;
     132   
     133    std::list<obj>          dataVector_;
     134    GamestateHeader*        header_;
     135    std::vector<uint32_t>   sizes_;
     136    uint32_t                nrOfVariables_;
    132137};
    133138
  • code/branches/presentation3/src/libraries/network/packet/Packet.cc

    r6417 r7153  
    6969  enetPacket_=0;
    7070  bDataENetAllocated_ = false;
    71 }
    72 
    73 void blub(ENetPacket *packet){
    74   COUT(4) << "blubb" << std::endl;
    7571}
    7672
  • code/branches/presentation3/src/libraries/network/synchronisable/Serialise.h

    r6964 r7153  
    7474            return *(uint32_t*)(mem) == variable->getObjectID();
    7575        else
    76             return *(uint32_t*)(mem) == OBJECTID_UNKNOWN;
     76            return variable == variable->getSynchronisable(*(uint32_t*)(mem));
    7777    }
    7878   
  • code/branches/presentation3/src/libraries/network/synchronisable/Synchronisable.cc

    r6961 r7153  
    4949  * Initializes all Variables and sets the right objectID_
    5050  */
    51   Synchronisable::Synchronisable(BaseObject* creator ){
     51  Synchronisable::Synchronisable(BaseObject* creator )
     52  {
    5253    RegisterRootObject(Synchronisable);
    5354    static uint32_t idCounter=0;
     
    7374    else
    7475      this->creatorID_ = OBJECTID_UNKNOWN;
    75 
    76     /*searchcreatorID:
    77     if (creator)
    78     {
    79         Synchronisable* synchronisable_creator = orxonox_cast<Synchronisable*>(creator);
    80         if (synchronisable_creator && synchronisable_creator->objectMode_)
    81         {
    82             this->creatorID = synchronisable_creator->getScene()->getObjectID();
    83         }
    84         else if (creator != creator->getCreator())
    85         {
    86             creator = creator->getCreator();
    87             goto searchcreatorID;
    88         }
    89     }*/
    9076  }
    9177
     
    9480   * Delete all callback objects and remove objectID_ from the objectMap_
    9581   */
    96   Synchronisable::~Synchronisable(){
     82  Synchronisable::~Synchronisable()
     83  {
    9784    // delete callback function objects
    9885    if(!Identifier::isCreatingHierarchy()){
     
    10188        deletedObjects_.push(objectID_);
    10289    }
    103     // delete all Synchronisable Variables from syncList ( which are also in stringList )
    104     for(std::vector<SynchronisableVariableBase*>::iterator it = syncList.begin(); it!=syncList.end(); it++)
     90    // delete all Synchronisable Variables from syncList_ ( which are also in stringList_ )
     91    for(std::vector<SynchronisableVariableBase*>::iterator it = syncList_.begin(); it!=syncList_.end(); it++)
    10592      delete (*it);
    106     syncList.clear();
    107     stringList.clear();
     93    syncList_.clear();
     94    stringList_.clear();
    10895    std::map<uint32_t, Synchronisable*>::iterator it;
    10996    it = objectMap_.find(objectID_);
     
    118105   * @param b true if this object is located on a client or on a server
    119106   */
    120   void Synchronisable::setClient(bool b){
     107  void Synchronisable::setClient(bool b)
     108  {
    121109    if(b) // client
    122110      state_=0x2;
     
    135123  {
    136124    SynchronisableHeader header(mem);
    137 
    138     if(!header.isDataAvailable())
    139     {
    140       mem += header.getDataSize();
    141       return 0;
    142     }
     125    assert( !header.isDiffed() );
    143126
    144127    COUT(4) << "fabricating object with id: " << header.getObjectID() << std::endl;
     
    160143      if (!synchronisable_creator)
    161144      {
    162         mem += header.getDataSize(); //.TODO: this suckz.... remove size from header
     145        mem += header.getDataSize()+SynchronisableHeader::getSize(); //.TODO: this suckz.... remove size from header
    163146        assert(0); // TODO: uncomment this if we have a clean objecthierarchy (with destruction of children of objects) ^^
    164147        return 0;
     
    198181   * @return true/false
    199182   */
    200   bool Synchronisable::deleteObject(uint32_t objectID_){
     183  bool Synchronisable::deleteObject(uint32_t objectID_)
     184  {
    201185    if(!getSynchronisable(objectID_))
    202186      return false;
     
    215199   * @return pointer to the Synchronisable with the objectID_
    216200   */
    217   Synchronisable* Synchronisable::getSynchronisable(uint32_t objectID_){
     201  Synchronisable* Synchronisable::getSynchronisable(uint32_t objectID_)
     202  {
    218203    std::map<uint32_t, Synchronisable*>::iterator it1;
    219204    it1 = objectMap_.find(objectID_);
    220205    if (it1 != objectMap_.end())
    221206      return it1->second;
    222 
    223 //     ObjectList<Synchronisable>::iterator it;
    224 //     for(it = ObjectList<Synchronisable>::begin(); it; ++it){
    225 //       if( it->getObjectID()==objectID_ ){
    226 //         objectMap_[objectID_] = *it;
    227 //         return *it;
    228 //       }
    229 //     }
    230207    // if the objects not in the map it should'nt exist at all anymore
    231208    return NULL;
     
    247224   * @return true: if !doSync or if everything was successfully saved
    248225   */
    249   uint32_t Synchronisable::getData(uint8_t*& mem, int32_t id, uint8_t mode){
     226  uint32_t Synchronisable::getData(uint8_t*& mem, std::vector<uint32_t>& sizes, int32_t id, uint8_t mode)
     227  {
     228    unsigned int test = 0;
    250229    if(mode==0x0)
    251230      mode=state_;
     
    255234    uint32_t tempsize = 0;
    256235#ifndef NDEBUG
     236    uint8_t* oldmem = mem;
    257237    if (this->classID_==0)
    258238      COUT(3) << "classid 0 " << this->getIdentifier()->getName() << std::endl;
     
    272252    // end copy header
    273253
    274 
    275     COUT(5) << "Synchronisable getting data from objectID_: " << objectID_ << " classID_: " << classID_ << std::endl;
     254    CCOUT(5) << "getting data from objectID_: " << objectID_ << ", classID_: " << classID_ << std::endl;
     255//     COUT(4) << "objectid: " << this->objectID_ << ":";
    276256    // copy to location
    277     for(i=syncList.begin(); i!=syncList.end(); ++i){
    278       tempsize += (*i)->getData( mem, mode );
     257    for(i=syncList_.begin(); i!=syncList_.end(); ++i)
     258    {
     259      uint32_t varsize = (*i)->getData( mem, mode );
     260//       COUT(4) << " " << varsize;
     261      tempsize += varsize;
     262      sizes.push_back(varsize);
     263      ++test;
    279264      //tempsize += (*i)->getSize( mode );
    280265    }
    281 
    282     tempsize += SynchronisableHeader::getSize();
     266//     COUT(4) << endl;
     267
    283268    header.setObjectID( this->objectID_ );
    284269    header.setCreatorID( this->creatorID_ );
    285270    header.setClassID( this->classID_ );
    286     header.setDataAvailable( true );
    287271    header.setDataSize( tempsize );
     272    assert( tempsize == mem-oldmem-SynchronisableHeader::getSize() );
     273    assert( test == this->getNrOfVariables() );
     274    header.setDiffed(false);
     275    tempsize += SynchronisableHeader::getSize();
    288276
    289277#ifndef NDEBUG
     
    302290   * @return true/false
    303291   */
    304   bool Synchronisable::updateData(uint8_t*& mem, uint8_t mode, bool forceCallback){
     292  bool Synchronisable::updateData(uint8_t*& mem, uint8_t mode, bool forceCallback)
     293  {
    305294    if(mode==0x0)
    306295      mode=state_;
    307     std::vector<SynchronisableVariableBase *>::iterator i;
    308     if(syncList.empty()){
     296    if(syncList_.empty())
     297    {
    309298      assert(0);
    310       COUT(4) << "Synchronisable::updateData syncList is empty" << std::endl;
     299      COUT(2) << "Synchronisable::updateData syncList_ is empty" << std::endl;
    311300      return false;
    312301    }
     
    314303    uint8_t* data=mem;
    315304    // start extract header
    316     SynchronisableHeader syncHeader(mem);
    317     assert(syncHeader.getObjectID()==this->objectID_);
    318     assert(syncHeader.getCreatorID()==this->creatorID_);
    319     assert(syncHeader.getClassID()==this->classID_);
    320     if(syncHeader.isDataAvailable()==false){
    321       mem += syncHeader.getDataSize();
    322       return true;
    323     }
    324 
    325     mem += SynchronisableHeader::getSize();
    326     // stop extract header
     305    SynchronisableHeaderLight syncHeaderLight(mem);
     306    assert(syncHeaderLight.getObjectID()==this->getObjectID());
    327307
    328308    //COUT(5) << "Synchronisable: objectID_ " << syncHeader.getObjectID() << ", classID_ " << syncHeader.getClassID() << " size: " << syncHeader.getDataSize() << " synchronising data" << std::endl;
    329     for(i=syncList.begin(); i!=syncList.end(); i++)
    330     {
    331       assert( mem <= data+syncHeader.getDataSize() ); // always make sure we don't exceed the datasize in our stream
    332       (*i)->putData( mem, mode, forceCallback );
    333     }
    334     assert(mem == data+syncHeader.getDataSize());
     309    if( !syncHeaderLight.isDiffed() )
     310    {
     311      SynchronisableHeader syncHeader2(mem);
     312      assert( this->getClassID() == syncHeader2.getClassID() );
     313      assert( this->getCreatorID() == syncHeader2.getCreatorID() );
     314      mem += SynchronisableHeader::getSize();
     315      std::vector<SynchronisableVariableBase *>::iterator i;
     316      for(i=syncList_.begin(); i!=syncList_.end(); i++)
     317      {
     318        assert( mem <= data+syncHeader2.getDataSize()+SynchronisableHeader::getSize() ); // always make sure we don't exceed the datasize in our stream
     319        (*i)->putData( mem, mode, forceCallback );
     320      }
     321      assert(mem == data+syncHeaderLight.getDataSize()+SynchronisableHeader::getSize() );
     322    }
     323    else
     324    {
     325      mem += SynchronisableHeaderLight::getSize();
     326//       COUT(0) << "objectID: " << this->objectID_ << endl;
     327      while( mem < data+syncHeaderLight.getDataSize()+SynchronisableHeaderLight::getSize() )
     328      {
     329        VariableID varID = *(VariableID*)mem;
     330//         COUT(0) << "varID: " << varID << endl;
     331        assert( varID < syncList_.size() );
     332        mem += sizeof(VariableID);
     333        syncList_[varID]->putData( mem, mode, forceCallback );
     334      }
     335      assert(mem == data+syncHeaderLight.getDataSize()+SynchronisableHeaderLight::getSize() );
     336    }
    335337    return true;
    336338  }
     
    342344  * @return amount of bytes
    343345  */
    344   uint32_t Synchronisable::getSize(int32_t id, uint8_t mode){
    345     int tsize=SynchronisableHeader::getSize();
     346  uint32_t Synchronisable::getSize(int32_t id, uint8_t mode)
     347  {
     348    uint32_t tsize=SynchronisableHeader::getSize();
    346349    if (mode==0x0)
    347350      mode=state_;
     
    351354    tsize += this->dataSize_;
    352355    std::vector<SynchronisableVariableBase*>::iterator i;
    353     for(i=stringList.begin(); i!=stringList.end(); ++i){
     356    for(i=stringList_.begin(); i!=stringList_.end(); ++i)
     357    {
    354358      tsize += (*i)->getSize( mode );
    355359    }
     
    362366   * @return true/false
    363367   */
    364   bool Synchronisable::doSync(int32_t id, uint8_t mode){
     368  bool Synchronisable::doSync(int32_t id, uint8_t mode)
     369  {
    365370    if(mode==0x0)
    366371      mode=state_;
    367     return ( (this->objectMode_ & mode)!=0 && (!syncList.empty() ) );
    368   }
    369 
    370   /**
    371    * This function looks at the header located in the bytestream and checks wheter objectID_ and classID_ match with the Synchronisables ones
    372    * @param mem pointer to the bytestream
    373    */
    374   bool Synchronisable::isMyData(uint8_t* mem)
    375   {
    376     SynchronisableHeader header(mem);
    377     assert(header.getObjectID()==this->objectID_);
    378     return header.isDataAvailable();
     372    return ( (this->objectMode_ & mode)!=0 && (!syncList_.empty() ) );
    379373  }
    380374
     
    387381   * @param mode same as in registerVar
    388382   */
    389   void Synchronisable::setSyncMode(uint8_t mode){
     383  void Synchronisable::setSyncMode(uint8_t mode)
     384  {
    390385    assert(mode==0x0 || mode==0x1 || mode==0x2 || mode==0x3);
    391386    this->objectMode_=mode;
     
    399394    else
    400395      sv = new SynchronisableVariable<std::string>(variable, mode, cb);
    401     syncList.push_back(sv);
    402     stringList.push_back(sv);
     396    syncList_.push_back(sv);
     397    stringList_.push_back(sv);
     398  }
     399
     400template <> void Synchronisable::unregisterVariable( std::string& variable )
     401  {
     402    bool unregistered_nonexistent_variable = true;
     403    std::vector<SynchronisableVariableBase*>::iterator it = syncList_.begin();
     404    while(it!=syncList_.end())
     405    {
     406      if( ((*it)->getReference()) == &variable )
     407      {
     408        delete (*it);
     409        syncList_.erase(it);
     410        unregistered_nonexistent_variable = false;
     411        break;
     412      }
     413      else
     414        ++it;
     415    }
     416    assert(unregistered_nonexistent_variable == false);
     417   
     418    it = stringList_.begin();
     419    while(it!=stringList_.end())
     420    {
     421      if( ((*it)->getReference()) == &variable )
     422      {
     423        delete (*it);
     424        stringList_.erase(it);
     425        return;
     426      }
     427      else
     428        ++it;
     429    }
     430    unregistered_nonexistent_variable = true;
     431    assert(unregistered_nonexistent_variable == false); //if we reach this point something went wrong:
     432    // the variable has not been registered before
    403433  }
    404434
  • code/branches/presentation3/src/libraries/network/synchronisable/Synchronisable.h

    r7127 r7153  
    6565    };
    6666  }
     67 
     68  typedef uint8_t VariableID;
    6769
    6870  /**
     
    7274   * in an emulated bitset.
    7375   * Bit 1 to 31 store the size of the Data the synchronisable consumes in the stream
    74    * Bit 32 is a bool and defines whether the data is actually stored or is just filled up with 0
     76   * Bit 32 is a bool and defines whether the variables are stored in diff mode
    7577   * Byte 5 to 8: objectID_
    7678   * Byte 9 to 12: classID_
     
    7880   */
    7981  class _NetworkExport SynchronisableHeader{
     82    friend class SynchronisableHeaderLight;
    8083    private:
    81       uint8_t *data_;
     84      uint8_t* data_;
    8285    public:
    8386      SynchronisableHeader(uint8_t* data)
    8487        { data_ = data; }
    8588      inline static uint32_t getSize()
    86         { return 16; }
    87       inline uint32_t getDataSize() const
    88         { return (*(uint32_t*)data_) & 0x7FFFFFFF; } //only use the first 31 bits
    89       inline void setDataSize(uint32_t size)
    90         { *(uint32_t*)(data_) = (size & 0x7FFFFFFF) | (*(uint32_t*)(data_) & 0x80000000 ); }
    91       inline bool isDataAvailable() const
    92         { return ( (*(uint32_t*)data_) & 0x80000000 ) == 0x80000000; }
    93       inline void setDataAvailable( bool b)
    94         { *(uint32_t*)(data_) = (b << 31) | (*(uint32_t*)(data_) & 0x7FFFFFFF ); }
     89        { return 14; }
     90      inline uint16_t getDataSize() const
     91        { return (*(uint16_t*)data_) & 0x7FFF; } //only use the first 31 bits
     92      inline void setDataSize(uint16_t size)
     93        { *(uint16_t*)(data_) = (size & 0x7FFFFFFF) | (*(uint16_t*)(data_) & 0x8000 ); }
     94      inline bool isDiffed() const
     95        { return ( (*(uint16_t*)data_) & 0x8000 ) == 0x8000; }
     96      inline void setDiffed( bool b)
     97        { *(uint16_t*)(data_) = (b << 15) | (*(uint16_t*)(data_) & 0x7FFF ); }
    9598      inline uint32_t getObjectID() const
    96         { return *(uint32_t*)(data_+4); }
     99        { return *(uint32_t*)(data_+2); }
    97100      inline void setObjectID(uint32_t objectID_)
    98         { *(uint32_t*)(data_+4) = objectID_; }
     101        { *(uint32_t*)(data_+2) = objectID_; }
    99102      inline uint32_t getClassID() const
    100         { return *(uint32_t*)(data_+8); }
     103        { return *(uint32_t*)(data_+6); }
    101104      inline void setClassID(uint32_t classID_)
    102         { *(uint32_t*)(data_+8) = classID_; }
     105        { *(uint32_t*)(data_+6) = classID_; }
    103106      inline uint32_t getCreatorID() const
    104         { return *(uint32_t*)(data_+12); }
     107        { return *(uint32_t*)(data_+10); }
    105108      inline void setCreatorID(uint32_t creatorID_)
    106         { *(uint32_t*)(data_+12) = creatorID_; }
     109        { *(uint32_t*)(data_+10) = creatorID_; }
    107110      inline void operator=(SynchronisableHeader& h)
    108111        { memcpy(data_, h.data_, getSize()); }
    109112  };
    110113
     114    /**
     115   * @brief: stores information about a Synchronisable (light version)
     116   *
     117   * This class stores the information about a Synchronisable (objectID_, dataSize)
     118   * in an emulated bitset.
     119   * Bit 1 to 31 store the size of the Data the synchronisable consumes in the stream
     120   * Bit 32 is a bool and defines whether the variables are stored in diff mode
     121   * Byte 5 to 8: objectID_
     122   */
     123  class _NetworkExport SynchronisableHeaderLight{
     124    private:
     125      uint8_t* data_;
     126    public:
     127      SynchronisableHeaderLight(uint8_t* data)
     128        { data_ = data; }
     129      inline static uint32_t getSize()
     130        { return 6; }
     131      inline uint16_t getDataSize() const
     132        { return (*(uint16_t*)data_) & 0x7FFF; } //only use the first 31 bits
     133      inline void setDataSize(uint16_t size)
     134        { *(uint16_t*)(data_) = (size & 0x7FFFFFFF) | (*(uint16_t*)(data_) & 0x8000 ); }
     135      inline bool isDiffed() const
     136        { return ( (*(uint16_t*)data_) & 0x8000 ) == 0x8000; }
     137      inline void setDiffed( bool b)
     138        { *(uint16_t*)(data_) = (b << 15) | (*(uint16_t*)(data_) & 0x7FFF ); }
     139      inline uint32_t getObjectID() const
     140        { return *(uint32_t*)(data_+2); }
     141      inline void setObjectID(uint32_t objectID_)
     142        { *(uint32_t*)(data_+2) = objectID_; }
     143      inline void operator=(SynchronisableHeader& h)
     144        { memcpy(data_, h.data_, getSize()); }
     145  };
    111146
    112147  /**
     
    135170
    136171    void setSyncMode(uint8_t mode);
     172   
     173    inline uint32_t getNrOfVariables(){ return this->syncList_.size(); }
     174    inline uint32_t getVarSize( VariableID ID )
     175    { return this->syncList_[ID]->getSize(state_); }
    137176
    138177  protected:
     
    140179    template <class T> void registerVariable(T& variable, uint8_t mode=0x1, NetworkCallbackBase *cb=0, bool bidirectional=false);
    141180    template <class T> void registerVariable(std::set<T>& variable, uint8_t mode=0x1, NetworkCallbackBase *cb=0, bool bidirectional=false);
     181    template <class T> void unregisterVariable(T& var);
    142182
    143183    void setPriority(unsigned int freq){ objectFrequency_ = freq; }
     
    145185
    146186  private:
    147     uint32_t getData(uint8_t*& men, int32_t id, uint8_t mode=0x0);
     187    uint32_t getData(uint8_t*& mem, std::vector<uint32_t>& sizes, int32_t id, uint8_t mode);
    148188    uint32_t getSize(int32_t id, uint8_t mode=0x0);
    149189    bool updateData(uint8_t*& mem, uint8_t mode=0x0, bool forceCallback=false);
    150     bool isMyData(uint8_t* mem);
    151190    bool doSync(int32_t id, uint8_t mode=0x0);
    152191
     
    158197    uint32_t classID_;
    159198
    160     std::vector<SynchronisableVariableBase*> syncList;
    161     std::vector<SynchronisableVariableBase*> stringList;
     199    std::vector<SynchronisableVariableBase*> syncList_;
     200    std::vector<SynchronisableVariableBase*> stringList_;
    162201    uint32_t dataSize_; //size of all variables except strings
    163202    static uint8_t state_; // detemines wheter we are server (default) or client
     
    173212    if (bidirectional)
    174213    {
    175       syncList.push_back(new SynchronisableVariableBidirectional<T>(variable, mode, cb));
    176       this->dataSize_ += syncList.back()->getSize(state_);
     214      syncList_.push_back(new SynchronisableVariableBidirectional<T>(variable, mode, cb));
     215      this->dataSize_ += syncList_.back()->getSize(state_);
    177216    }
    178217    else
    179218    {
    180       syncList.push_back(new SynchronisableVariable<T>(variable, mode, cb));
     219      syncList_.push_back(new SynchronisableVariable<T>(variable, mode, cb));
    181220      if ( this->state_ == mode )
    182         this->dataSize_ += syncList.back()->getSize(state_);
     221        this->dataSize_ += syncList_.back()->getSize(state_);
    183222    }
     223  }
     224 
     225  template <class T> void Synchronisable::unregisterVariable(T& variable){
     226    std::vector<SynchronisableVariableBase*>::iterator it = syncList_.begin();
     227    while(it!=syncList_.end()){
     228      if( ((*it)->getReference()) == &variable ){
     229        this->dataSize_ -= (*it)->getSize(Synchronisable::state_);
     230        delete (*it);
     231        syncList_.erase(it);
     232        return;
     233      }
     234      else
     235        it++;
     236    }
     237    bool unregistered_nonexistent_variable = false;
     238    assert(unregistered_nonexistent_variable); //if we reach this point something went wrong:
     239    // the variable has not been registered before
    184240  }
    185241
     
    191247    else
    192248      sv = new SynchronisableVariable<std::set<T> >(variable, mode, cb);
    193     syncList.push_back(sv);
    194     stringList.push_back(sv);
     249    syncList_.push_back(sv);
     250    stringList_.push_back(sv);
    195251  }
    196252
    197253  template <> _NetworkExport void Synchronisable::registerVariable( std::string& variable, uint8_t mode, NetworkCallbackBase *cb, bool bidirectional);
    198254//   template <class T> _NetworkExport void Synchronisable::registerVariable<std::set<T> >( std::set<T>& variable, uint8_t mode, NetworkCallbackBase *cb, bool bidirectional);
     255  template <> _NetworkExport void Synchronisable::unregisterVariable( std::string& variable );
    199256
    200257
  • code/branches/presentation3/src/modules/objects/Planet.h

    r6501 r7153  
    9494
    9595        protected:
    96             void registerVariables();
    9796
    9897        private:
     98            void registerVariables();
    9999
    100100            void changedMesh();
  • code/branches/presentation3/src/modules/objects/collisionshapes/BoxCollisionShape.h

    r5781 r7153  
    4343            virtual ~BoxCollisionShape();
    4444
    45             void registerVariables();
    4645            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    4746
     
    6766
    6867        private:
     68            void registerVariables();
     69
    6970            btCollisionShape* createNewShape() const;
    7071
  • code/branches/presentation3/src/modules/objects/collisionshapes/ConeCollisionShape.h

    r5781 r7153  
    4141            virtual ~ConeCollisionShape();
    4242
    43             void registerVariables();
    4443            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    4544
     
    5554
    5655        private:
     56            void registerVariables();
     57
    5758            btCollisionShape* createNewShape() const;
    5859
  • code/branches/presentation3/src/modules/objects/collisionshapes/PlaneCollisionShape.h

    r5781 r7153  
    4343            virtual ~PlaneCollisionShape();
    4444
    45             void registerVariables();
    4645            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    4746
     
    5756
    5857        private:
     58            void registerVariables();
     59
    5960            btCollisionShape* createNewShape()const;
    6061
  • code/branches/presentation3/src/modules/objects/collisionshapes/SphereCollisionShape.h

    r5781 r7153  
    4141            virtual ~SphereCollisionShape();
    4242
    43             void registerVariables();
    4443            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    4544
     
    5049
    5150        private:
     51            void registerVariables();
     52
    5253            btCollisionShape* createNewShape() const;
    5354
  • code/branches/presentation3/src/modules/pong/PongBall.h

    r5929 r7153  
    4545            virtual void tick(float dt);
    4646
    47             void registerVariables();
    48 
    4947            void setFieldDimension(float width, float height)
    5048                { this->fieldWidth_ = width; this->fieldHeight_ = height; }
     
    7472
    7573        private:
     74            void registerVariables();
     75
    7676            float fieldWidth_;
    7777            float fieldHeight_;
  • code/branches/presentation3/src/modules/pong/PongBat.h

    r5781 r7153  
    4141            virtual ~PongBat() {}
    4242
    43             void registerVariables();
    4443            virtual void tick(float dt);
    4544
     
    6564
    6665        private:
     66            void registerVariables();
     67
    6768            float movement_;
    6869            bool bMoveLocal_;
  • code/branches/presentation3/src/modules/weapons/weaponmodes/RocketFire.cc

    r6732 r7153  
    6666        rocket->setOrientation(this->getMuzzleOrientation());
    6767        rocket->setPosition(this->getMuzzlePosition());
    68         rocket->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_);
     68//         rocket->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_);
     69        rocket->setVelocity(Vector3(1,0,0));
    6970        rocket->scale(2);
    7071
  • code/branches/presentation3/src/orxonox/CMakeLists.txt

    r7152 r7153  
    3434  ChatHistory.cc
    3535  ChatInputHandler.cc
     36#  Test.cc
    3637COMPILATION_BEGIN SceneCompilation.cc
    3738  CameraManager.cc
  • code/branches/presentation3/src/orxonox/Level.h

    r7105 r7153  
    4848
    4949            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    50             void registerVariables();
    5150
    5251            inline void setDescription(const std::string& description)
     
    6261
    6362        private:
     63            void registerVariables();
    6464            void addObject(BaseObject* object);
    6565            BaseObject* getObject(unsigned int index) const;
  • code/branches/presentation3/src/orxonox/Test.h

    r7105 r7153  
    5050
    5151      void setConfigValues();
    52       void registerVariables();
    5352
    5453      static void call(unsigned int clientID);
     
    8786
    8887    private:
     88      void registerVariables();
     89
    8990      UTYPE u1;
    9091      UTYPE u2;
  • code/branches/presentation3/src/orxonox/collisionshapes/CollisionShape.h

    r5781 r7153  
    4545
    4646            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    47             void registerVariables();
    4847
    4948            inline void setPosition(const Vector3& position)
     
    8887
    8988        private:
     89            void registerVariables();
     90
    9091            Vector3                 position_;
    9192            Quaternion              orientation_;
  • code/branches/presentation3/src/orxonox/graphics/Backlight.h

    r5781 r7153  
    4545
    4646            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    47             void registerVariables();
    4847
    4948            virtual void tick(float dt);
     
    8180
    8281        private:
     82            void registerVariables();
    8383            virtual void startturnonoff();
    8484            virtual void stopturnonoff();
  • code/branches/presentation3/src/orxonox/graphics/Billboard.h

    r5781 r7153  
    4646
    4747            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    48             void registerVariables();
    4948
    5049            virtual void changedVisibility();
     
    7877
    7978        private:
     79            void registerVariables();
    8080            void changedMaterial();
    8181//            void changedRotation();
  • code/branches/presentation3/src/orxonox/graphics/BlinkingBillboard.cc

    r6417 r7153  
    6666    void BlinkingBillboard::registerVariables()
    6767    {
    68 //        registerVariable(this->amplitude_, VariableDirection::ToClient);
    69 //        registerVariable(this->frequency_, VariableDirection::ToClient);
    70 //        registerVariable(this->phase_,     VariableDirection::ToClient);
     68        unregisterVariable(this->getScale3D());
     69        registerVariable(this->amplitude_,  VariableDirection::ToClient);
     70        registerVariable(this->frequency_,  VariableDirection::ToClient);
     71        registerVariable(this->phase_,      VariableDirection::ToClient);
     72        registerVariable(this->bQuadratic_, VariableDirection::ToClient);
    7173    }
    7274
     
    7577        SUPER(BlinkingBillboard, tick, dt);
    7678
    77         if (GameMode::isMaster() && this->isActive())
     79        if (this->isActive())
    7880        {
    7981            this->time_ += dt;
  • code/branches/presentation3/src/orxonox/graphics/BlinkingBillboard.h

    r5781 r7153  
    4545
    4646            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    47             void registerVariables();
    4847
    4948            virtual void tick(float dt);
     
    7069
    7170        private:
     71            void registerVariables();
     72           
    7273            float amplitude_;
    7374            float frequency_;
  • code/branches/presentation3/src/orxonox/graphics/FadingBillboard.h

    r5929 r7153  
    4646
    4747            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    48             void registerVariables();
    4948
    5049            virtual void tick(float dt);
     
    6665
    6766        protected:
     67            void registerVariables();
    6868            virtual void startturnonoff();
    6969            virtual void stopturnonoff();
  • code/branches/presentation3/src/orxonox/graphics/GlobalShader.h

    r5781 r7153  
    4545
    4646            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    47             void registerVariables();
    4847
    4948            virtual void changedVisibility();
     
    5352
    5453        private:
     54            void registerVariables();
    5555            void changedCompositor();
    5656
  • code/branches/presentation3/src/orxonox/graphics/Light.h

    r5781 r7153  
    5757
    5858            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    59             void registerVariables();
    6059
    6160            virtual void changedVisibility();
     
    132131
    133132        private:
     133            void registerVariables();
    134134            void setTypeString(const std::string& type);
    135135            std::string getTypeString() const;
  • code/branches/presentation3/src/orxonox/graphics/Model.h

    r7127 r7153  
    4545
    4646            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    47             void registerVariables();
    4847
    4948            virtual void changedVisibility();
     
    6362
    6463        protected:
     64            void registerVariables();
    6565            void changedMesh();
    6666            void changedShadows();
  • code/branches/presentation3/src/orxonox/graphics/ParticleEmitter.h

    r5781 r7153  
    4444
    4545            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    46             void registerVariables();
    4746
    4847            virtual void changedVisibility();
     
    7473            std::string        source_;
    7574            LODParticle::Value   LOD_;
     75
     76        private:
     77            void registerVariables();
    7678    };
    7779}
  • code/branches/presentation3/src/orxonox/infos/GametypeInfo.h

    r7062 r7153  
    4545            virtual ~GametypeInfo();
    4646
    47             void registerVariables();
    48 
    4947            inline bool hasStarted() const
    5048                { return this->bStarted_; }
     
    7472
    7573        private:
     74            void registerVariables();
     75
    7676            bool bStarted_;
    7777            bool bEnded_;
  • code/branches/presentation3/src/orxonox/infos/HumanPlayer.h

    r5781 r7153  
    4343            virtual ~HumanPlayer();
    4444
    45             void registerVariables();
    4645            void setConfigValues();
    4746
     
    101100            std::string gametypeHudTemplate_;
    102101            OverlayGroup* gametypeHud_;
     102        private:
     103            void registerVariables();
    103104    };
    104105}
  • code/branches/presentation3/src/orxonox/infos/PlayerInfo.h

    r7072 r7153  
    4343            PlayerInfo(BaseObject* creator);
    4444            virtual ~PlayerInfo();
    45 
    46             void registerVariables();
    4745
    4846            virtual void changedName();
     
    9290
    9391        private:
     92            void registerVariables();
    9493            void networkcallback_changedcontrollableentityID();
    9594            void networkcallback_changedgtinfoID();
  • code/branches/presentation3/src/orxonox/items/Engine.h

    r6711 r7153  
    4646
    4747            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    48             void registerVariables();
    4948            void setConfigValues();
    5049
     
    127126
    128127        private:
     128            void registerVariables();
    129129            void networkcallback_shipID();
    130130
  • code/branches/presentation3/src/orxonox/items/MultiStateEngine.h

    r6417 r7153  
    5353
    5454            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    55             void registerVariables();
    5655
    5756            virtual void tick(float dt);
     
    6867
    6968        private:
     69            void registerVariables();
     70
    7071            int state_;
    7172            int oldState_;
  • code/branches/presentation3/src/orxonox/sound/BaseSound.cc

    r6502 r7153  
    248248        else // No source acquired so far, but might be set to playing or paused
    249249        {
    250             State state = this->state_; // save
     250            State state = static_cast<State>(this->state_); // save
    251251            if (this->isPlaying() || this->isPaused())
    252252                doPlay();
  • code/branches/presentation3/src/orxonox/sound/BaseSound.h

    r6417 r7153  
    112112        float           volume_;
    113113        bool            bLooping_;
    114         State           state_;
     114        uint8_t         state_;       // This Variable is actually of type State
    115115        float           pitch_;
    116116
  • code/branches/presentation3/src/orxonox/sound/WorldSound.cc

    r6417 r7153  
    5858        registerVariable(bLooping_, ObjectDirection::ToClient, new NetworkCallback<WorldSound>(this, &WorldSound::loopingChanged));
    5959        registerVariable(pitch_,    ObjectDirection::ToClient, new NetworkCallback<WorldSound>(this, &WorldSound::pitchChanged));
    60         registerVariable((int&)(BaseSound::state_), ObjectDirection::ToClient, new NetworkCallback<WorldSound>(this, &WorldSound::stateChanged));
     60        registerVariable((uint8_t&)(BaseSound::state_), ObjectDirection::ToClient, new NetworkCallback<WorldSound>(this, &WorldSound::stateChanged));
    6161    }
    6262
  • code/branches/presentation3/src/orxonox/worldentities/BigExplosion.cc

    r5929 r7153  
    101101        this->debrisEntity3_ = new MovableEntity(this);
    102102        this->debrisEntity4_ = new MovableEntity(this);
     103       
     104        this->debrisEntity1_->setSyncMode(0);
     105        this->debrisEntity2_->setSyncMode(0);
     106        this->debrisEntity3_->setSyncMode(0);
     107        this->debrisEntity4_->setSyncMode(0);
    103108
    104109        this->debris1_ = new Model(this);
     
    106111        this->debris3_ = new Model(this);
    107112        this->debris4_ = new Model(this);
     113       
     114        this->debris1_->setSyncMode(0);
     115        this->debris2_->setSyncMode(0);
     116        this->debris3_->setSyncMode(0);
     117        this->debris4_->setSyncMode(0);
    108118
    109119        this->explosion_ = new StaticEntity(this);
     120        this->explosion_->setSyncMode(0);
    110121
    111122        this->debrisSmoke1_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/smoke7", this->LOD_);
     
    158169        effect->setSource("Orxonox/explosion2b");
    159170        effect->setLifetime(4.0f);
     171        effect->setSyncMode(0);
    160172
    161173        ParticleSpawner* effect2 = new ParticleSpawner(this->getCreator());
     
    163175        effect2->setSource("Orxonox/smoke6");
    164176        effect2->setLifetime(4.0f);
     177        effect2->setSyncMode(0);
    165178
    166179        this->explosion_->attach(effect);
     
    181194            MovableEntity* partEntity1 = new MovableEntity(this);
    182195            MovableEntity* partEntity2 = new MovableEntity(this);
     196           
     197            part1->setSyncMode(0);
     198            part2->setSyncMode(0);
     199            partEntity1->setSyncMode(0);
     200            partEntity2->setSyncMode(0);
    183201
    184202            partEntity1->setVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1))*rnd(10,100));
  • code/branches/presentation3/src/orxonox/worldentities/BigExplosion.h

    r5929 r7153  
    4545
    4646            virtual void tick(float dt);
    47             void registerVariables();
    4847
    4948            inline void setLOD(LODParticle::Value level)
     
    5352
    5453        private:
     54            void registerVariables();
    5555
    5656            void LODchanged();
  • code/branches/presentation3/src/orxonox/worldentities/ControllableEntity.h

    r7073 r7153  
    4949            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    5050            virtual void tick(float dt);
    51             void registerVariables();
    5251            void setConfigValues();
    5352
     
    167166
    168167        private:
     168            void registerVariables();
    169169            void setXMLController(Controller* controller);
    170170
  • code/branches/presentation3/src/orxonox/worldentities/ExplosionChunk.h

    r5929 r7153  
    4444
    4545            virtual void tick(float dt);
    46             void registerVariables();
    4746
    4847            inline void setLOD(LODParticle::Value level)
     
    5251
    5352        private:
     53            void registerVariables();
    5454            void LODchanged();
    5555            void checkStop();
  • code/branches/presentation3/src/orxonox/worldentities/MobileEntity.cc

    r5781 r7153  
    4646        this->angularAcceleration_ = Vector3::ZERO;
    4747        this->angularVelocity_     = Vector3::ZERO;
    48 
    49         this->registerVariables();
    5048    }
    5149
  • code/branches/presentation3/src/orxonox/worldentities/MovableEntity.h

    r6417 r7153  
    4848            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    4949            virtual bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
    50             void registerVariables();
    5150
    5251            using WorldEntity::setPosition;
     
    7978
    8079        private:
     80            void registerVariables();
    8181            void clientConnected(unsigned int clientID);
    8282            void clientDisconnected(unsigned int clientID);
  • code/branches/presentation3/src/orxonox/worldentities/StaticEntity.h

    r5781 r7153  
    4242            virtual ~StaticEntity();
    4343
    44             void registerVariables();
    45 
    4644            using WorldEntity::setPosition;
    4745            using WorldEntity::setOrientation;
     
    5149
    5250        private:
     51            void registerVariables();
    5352            bool isCollisionTypeLegal(CollisionType type) const;
    5453
  • code/branches/presentation3/src/orxonox/worldentities/WorldEntity.h

    r7127 r7153  
    9494
    9595            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    96             void registerVariables();
    9796
    9897            inline const Ogre::SceneNode* getNode() const
     
    214213
    215214        private:
     215            void registerVariables();
     216           
    216217            inline void lookAt_xmlport(const Vector3& target)
    217218                { this->lookAt(target); }
  • code/branches/presentation3/src/orxonox/worldentities/pawns/Pawn.cc

    r7075 r7153  
    130130        registerVariable(this->shieldAbsorption_, VariableDirection::ToClient);
    131131        registerVariable(this->bReload_,          VariableDirection::ToServer);
    132         registerVariable(this->aimPosition_,      Bidirectionality::ServerMaster, 0, true);
     132        registerVariable(this->aimPosition_,      VariableDirection::ToServer);  // For the moment this variable gets only transfered to the server
    133133    }
    134134
  • code/branches/presentation3/src/orxonox/worldentities/pawns/Pawn.h

    r7075 r7153  
    5050            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    5151            virtual void tick(float dt);
    52             void registerVariables();
    5352
    5453            inline bool isAlive() const
     
    166165
    167166        private:
     167            void registerVariables();
    168168            inline void setWeaponSystem(WeaponSystem* weaponsystem)
    169169                { this->weaponSystem_ = weaponsystem; }
  • code/branches/presentation3/src/orxonox/worldentities/pawns/SpaceShip.h

    r6711 r7153  
    4747            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    4848            virtual void tick(float dt);
    49             void registerVariables();
    5049            void setConfigValues();
    5150
     
    9998
    10099        private:
     100            void registerVariables();
    101101            virtual bool isCollisionTypeLegal(WorldEntity::CollisionType type) const;
    102102
    103         private:
    104103            void loadEngineTemplate();
    105104
  • code/branches/presentation3/src/orxonox/worldentities/pawns/Spectator.h

    r6417 r7153  
    4444
    4545            void setConfigValues();
    46             void registerVariables();
    4746            virtual void tick(float dt);
    4847
     
    6362
    6463        private:
     64            void registerVariables();
    6565            void changedGreeting();
    6666            void changedFlareVisibility();
Note: See TracChangeset for help on using the changeset viewer.