Index: code/branches/Masterserver_FS18/src/libraries/network/Client.cc
===================================================================
--- code/branches/Masterserver_FS18/src/libraries/network/Client.cc	(revision 11982)
+++ code/branches/Masterserver_FS18/src/libraries/network/Client.cc	(revision 11983)
@@ -166,15 +166,8 @@
           }
         }
-        //assert(gs); <--- there might be the case that no data has to be sent, so its commented out now
-//         if(gs){
-//           orxout(verbose, context::network) << "client tick: sending gs " << gs << endl;
-//           if( !gs->send() )
-//             orxout(internal_warning, context::network) << "Problem adding partial gamestate to queue" << endl;
-//         // gs gets automatically deleted by enet callback
-//         }
+
         FunctionCallManager::sendCalls(static_cast<Host*>(this));
       }
     }
-//     sendPackets(); // flush the enet queue
 
     Connection::processQueue();
@@ -185,6 +178,5 @@
         isSynched_=true;
     }
-//     GamestateManager::cleanup();;
-//     Connection::sendPackets();
+
 
     return;
Index: code/branches/Masterserver_FS18/src/libraries/network/packet/Gamestate.cc
===================================================================
--- code/branches/Masterserver_FS18/src/libraries/network/packet/Gamestate.cc	(revision 11982)
+++ code/branches/Masterserver_FS18/src/libraries/network/packet/Gamestate.cc	(revision 11983)
@@ -46,5 +46,4 @@
 #define GAMESTATE_START(data) (data + GamestateHeader::getSize())
 
-// #define PACKET_FLAG_GAMESTATE  PacketFlag::Reliable
 #define PACKET_FLAG_GAMESTATE  0
 
@@ -128,6 +127,4 @@
   for(it = ObjectList<Synchronisable>().begin(); it; ++it)
   {
-
-//     tempsize=it->getSize(id, mode);
 
     tempsize = it->getData(mem, this->sizes_, id, mode);
@@ -196,5 +193,4 @@
       else
       {
-//         orxout(verbose, context::packets) << "not creating object of classid " << objectheader.getClassID() << endl;
         mem += objectheader.getDataSize() + ( objectheader.isDiffed() ? SynchronisableHeaderLight::getSize() : SynchronisableHeader::getSize() );
       }
@@ -202,5 +198,4 @@
     else
     {
-//       orxout(verbose, context::packets) << "updating object of classid " << objectheader.getClassID() << endl;
       OrxVerify(s->updateData(mem, mode), "ERROR: could not update Synchronisable with Gamestate data");
     }
@@ -339,5 +334,4 @@
   if( memcmp( origDataPtr+objectOffset, baseDataPtr+objectOffset, objectHeader.getDataSize()) == 0 )
   {
-//     orxout(verbose, context::packets) << "skip object " << Synchronisable::getSynchronisable(objectHeader.getObjectID())->getIdentifier()->getName() << endl;
     origDataPtr += objectOffset + objectHeader.getDataSize(); // skip the whole object
     baseDataPtr += objectOffset + objectHeader.getDataSize();
@@ -395,5 +389,4 @@
 inline void /*Gamestate::*/copyObject( uint8_t*& newData, uint8_t*& origData, uint8_t*& baseData, SynchronisableHeader& objectHeader, std::vector<uint32_t>::iterator& sizes )
 {
-  //       orxout(verbose, context::packets) << "docopy" << endl;
   // Just copy over the whole Object
   memcpy( newData, origData, objectHeader.getDataSize()+SynchronisableHeader::getSize() );
@@ -402,15 +395,7 @@
   newData += objectHeader.getDataSize()+SynchronisableHeader::getSize();
   origData += objectHeader.getDataSize()+SynchronisableHeader::getSize();
-//   SynchronisableHeader baseHeader( baseData );
-//   baseData += baseHeader.getDataSize()+SynchronisableHeader::getSize();
-  //       orxout(verbose, context::packets) << "copy " << h.getObjectID() << endl;
-  //       orxout(verbose, context::packets) << "copy " << h.getObjectID() << ":";
+
   sizes += Synchronisable::getSynchronisable(objectHeader.getObjectID())->getNrOfVariables();
-//   for( unsigned int i = 0; i < Synchronisable::getSynchronisable(objectHeader.getObjectID())->getNrOfVariables(); ++i )
-//   {
-//     //         orxout(verbose, context::packets) << " " << *sizes;
-//     ++sizes;
-//   }
-    //       orxout(verbose, context::packets) << endl;
+
 }
 
@@ -466,6 +451,5 @@
   uint8_t *origDataEnd = origDataPtr + header_.getDataSize();
   uint8_t *baseDataEnd = baseDataPtr + base->header_.getDataSize();
-//   uint32_t origLength = header_.getDataSize();
-//   uint32_t baseLength = base->header_.getDataSize();
+
 
   // Allocate new space for diffed gamestate
@@ -560,165 +544,4 @@
 
 
-/*Gamestate* Gamestate::diffData(Gamestate *base)
-{
-  assert(this && base); assert(data_ && base->data_);
-  assert(!header_.isCompressed() && !base->header_.isCompressed());
-  assert(!header_.isDiffed());
-
-  uint8_t *basep = GAMESTATE_START(base->data_);
-  uint8_t *gs = GAMESTATE_START(this->data_);
-  uint32_t dest_length = header_.getDataSize();
-
-  if(dest_length==0)
-    return nullptr;
-
-  uint8_t *ndata = new uint8_t[dest_length*sizeof(uint8_t)+GamestateHeader::getSize()];
-  uint8_t *dest = GAMESTATE_START(ndata);
-
-  rawDiff( dest, gs, basep, header_.getDataSize(), base->header_.getDataSize() );
-#ifndef NDEBUG
-  uint8_t *dest2 = new uint8_t[dest_length];
-  rawDiff( dest2, dest, basep, header_.getDataSize(), base->header_.getDataSize() );
-  assert( memcmp( dest2, gs, dest_length) == 0 );
-  delete dest2;
-#endif
-
-  Gamestate *g = new Gamestate(ndata, getClientID());
-  assert(g->header_);
-  *(g->header_) = *header_;
-  g->header_.setDiffed( true );
-  g->header_.setBaseID( base->getID() );
-  g->flags_=flags_;
-  g->packetDirection_ = packetDirection_;
-  assert(g->isDiffed());
-  assert(!g->isCompressed());
-  return g;
-}
-
-
-Gamestate* Gamestate::undiff(Gamestate *base)
-{
-  assert(this && base); assert(data_ && base->data_);
-  assert(!header_.isCompressed() && !base->header_.isCompressed());
-  assert(header_.isDiffed());
-
-  uint8_t *basep = GAMESTATE_START(base->data_);
-  uint8_t *gs = GAMESTATE_START(this->data_);
-  uint32_t dest_length = header_.getDataSize();
-
-  if(dest_length==0)
-    return nullptr;
-
-  uint8_t *ndata = new uint8_t[dest_length*sizeof(uint8_t)+GamestateHeader::getSize()];
-  uint8_t *dest = ndata + GamestateHeader::getSize();
-
-  rawDiff( dest, gs, basep, header_.getDataSize(), base->header_.getDataSize() );
-
-  Gamestate *g = new Gamestate(ndata, getClientID());
-  assert(g->header_);
-  *(g->header_) = *header_;
-  g->header_.setDiffed( false );
-  g->flags_=flags_;
-  g->packetDirection_ = packetDirection_;
-  assert(!g->isDiffed());
-  assert(!g->isCompressed());
-  return g;
-}
-
-
-void Gamestate::rawDiff( uint8_t* newdata, uint8_t* data, uint8_t* basedata, uint32_t datalength, uint32_t baselength)
-{
-  uint64_t* gd = (uint64_t*)data;
-  uint64_t* bd = (uint64_t*)basedata;
-  uint64_t* nd = (uint64_t*)newdata;
-
-  unsigned int i;
-  for( i=0; i<datalength/8; i++ )
-  {
-    if( i<baselength/8 )
-      *(nd+i) = *(gd+i) ^ *(bd+i);  // xor the data
-    else
-      *(nd+i) = *(gd+i); // just copy over the data
-  }
-  unsigned int j;
-  // now process the rest (when datalength isn't a multiple of 4)
-  for( j = 8*(datalength/8); j<datalength; j++ )
-  {
-    if( j<baselength )
-      *(newdata+j) = *(data+j) ^ *(basedata+j); // xor
-    else
-      *(newdata+j) = *(data+j); // just copy
-  }
-  assert(j==datalength);
-}*/
-
-
-/*Gamestate* Gamestate::doSelection(unsigned int clientID, unsigned int targetSize){
-  assert(data_);
-  std::list<obj>::iterator it;
-
-  // allocate memory for new data
-  uint8_t *gdata = new uint8_t[header_.getDataSize()+GamestateHeader::getSize()];
-  // create a gamestate out of it
-  Gamestate *gs = new Gamestate(gdata);
-  uint8_t *newdata = gdata + GamestateHeader::getSize();
-  uint8_t *origdata = GAMESTATE_START(data_);
-
-  //copy the GamestateHeader
-  assert(gs->header_);
-  *(gs->header_) = *header_;
-
-  uint32_t objectOffset;
-  unsigned int objectsize, destsize=0;
-  // TODO: Why is this variable not used?
-  //Synchronisable *object;
-
-  //call TrafficControl
-  TrafficControl::getInstance()->processObjectList( clientID, header_.getID(), dataVector_ );
-
-  //copy in the zeros
-//   std::list<obj>::iterator itt;
-//   orxout() << "myvector contains:";
-//   for ( itt=dataVector_.begin() ; itt!=dataVector_.end(); itt++ )
-//     orxout() << " " << (*itt).objID;
-//   orxout() << endl;
-  for(it=dataVector_.begin(); it!=dataVector_.end();){
-    SynchronisableHeader oldobjectheader(origdata);
-    SynchronisableHeader newobjectheader(newdata);
-    if ( (*it).objSize == 0 )
-    {
-      ++it;
-      continue;
-    }
-    objectsize = oldobjectheader.getDataSize()+SynchronisableHeader::getSize();
-    objectOffset=SynchronisableHeader::getSize(); //skip the size and the availableData variables in the objectheader
-    if ( (*it).objID == oldobjectheader.getObjectID() ){
-      memcpy(newdata, origdata, objectsize);
-      ++it;
-    }else{
-      newobjectheader = oldobjectheader;
-      memset(newdata+objectOffset, 0, objectsize-objectOffset);
-    }
-    newdata += objectsize;
-    origdata += objectsize;
-    destsize += objectsize;
-  }
-#ifndef NDEBUG
-  uint32_t origsize = destsize;
-  while ( origsize < header_.getDataSize() )
-  {
-    SynchronisableHeader oldobjectheader(origdata);
-    objectsize = oldobjectheader.getDataSize()+SynchronisableHeader::getSize();
-    origdata += objectsize;
-    origsize += objectsize;
-  }
-  assert(origsize==header_.getDataSize());
-  assert(destsize!=0);
-#endif
-  gs->header_.setDataSize( destsize );
-  return gs;
-}*/
-
-
 uint32_t Gamestate::calcGamestateSize(uint32_t id, uint8_t mode)
 {
Index: code/branches/Masterserver_FS18/src/libraries/network/packet/Gamestate.h
===================================================================
--- code/branches/Masterserver_FS18/src/libraries/network/packet/Gamestate.h	(revision 11982)
+++ code/branches/Masterserver_FS18/src/libraries/network/packet/Gamestate.h	(revision 11983)
@@ -57,6 +57,4 @@
     GamestateHeader(uint8_t* data)
       { assert(data); data_ = data; *(Type*)data_ = Type::Gamestate; }
-    /*GamestateHeader(uint8_t* data, GamestateHeader* h)
-      { assert(data); data_=data; memcpy(data_, h->data_, getSize()); }*/
     void setData(uint8_t* data)
       { assert(data); data_ = data; *(Type*)data_ = Type::Gamestate; }
@@ -127,7 +125,5 @@
     inline uint32_t getDataSize() const { return header_.getDataSize(); }
     Gamestate* diffVariables(Gamestate *base);
-//     Gamestate* diffData(Gamestate *base);
-//     Gamestate *undiff(Gamestate *base);
-//     Gamestate* doSelection(unsigned int clientID, unsigned int targetSize);
+
     bool compressData();
     bool decompressData();
@@ -136,12 +132,9 @@
     // Packet functions
   private:
-//     void rawDiff( uint8_t* newdata, uint8_t* data, uint8_t* basedata, uint32_t datalength, uint32_t baselength);
-//     inline uint32_t findObject( const SynchronisableHeader& header, uint8_t* mem, uint32_t dataLength, uint32_t startPosition = 0 );
+
     virtual uint32_t getSize() const override;
     virtual bool process(orxonox::Host* host) override;
     uint32_t calcGamestateSize(uint32_t id, uint8_t mode=0x0);
-//     inline void diffObject( uint8_t*& newData, uint8_t*& origData, uint8_t*& baseData, SynchronisableHeader& objectHeader, std::vector<uint32_t>::iterator& sizes );
-//     inline void copyObject( uint8_t*& newData, uint8_t*& origData, uint8_t*& baseData, SynchronisableHeader& objectHeader, std::vector<uint32_t>::iterator& sizes );
-    
+   
     std::list<obj>          dataVector_;
     GamestateHeader         header_;
Index: code/branches/Masterserver_FS18/src/libraries/network/synchronisable/Synchronisable.cc
===================================================================
--- code/branches/Masterserver_FS18/src/libraries/network/synchronisable/Synchronisable.cc	(revision 11982)
+++ code/branches/Masterserver_FS18/src/libraries/network/synchronisable/Synchronisable.cc	(revision 11983)
@@ -43,5 +43,5 @@
   std::queue<uint32_t> Synchronisable::deletedObjects_;
 
-  uint8_t Synchronisable::state_=0x1; // detemines wheter we are server (default) or client
+  uint8_t Synchronisable::state_=0x1; // determines wheter we are server (default) or client
 
   RegisterAbstractClass(Synchronisable).inheritsFrom<OrxonoxInterface>();
@@ -179,8 +179,6 @@
     assert( Synchronisable::objectMap_.find(header.getObjectID()) == Synchronisable::objectMap_.end() );
     no->setObjectID(header.getObjectID());
-    //no->contextID=header.getContextID(); //TODO: remove this
     no->setClassID(header.getClassID());
     assert(no->contextID_ == header.getContextID());
-    //assert(no->classID_ == header.getClassID());
     orxout(verbose, context::network) << "fabricate objectID_: " << no->objectID_ << " classID_: " << no->classID_ << endl;
           // update data and create object/entity...
@@ -189,5 +187,4 @@
     if (b)
     {
-//        b = no->create();
         assert(b);
     }
@@ -273,17 +270,13 @@
 
     orxout(verbose_more, context::network) << "getting data from objectID_: " << objectID_ << ", classID_: " << classID_ << endl;
-//     orxout(verbose, context::network) << "objectid: " << this->objectID_ << ":";
     // copy to location
     for(SynchronisableVariableBase* variable : syncList_)
     {
       uint32_t varsize = variable->getData( mem, mode );
-//       orxout(verbose, context::network) << " " << varsize;
       tempsize += varsize;
       sizes.push_back(varsize);
       ++test;
-      //tempsize += (*i)->getSize( mode );
     }
     assert(tempsize!=0);  // if this happens an empty object (with no variables) would be transmitted
-//     orxout(verbose, context::network) << endl;
 
     header.setObjectID( this->objectID_ );
@@ -340,5 +333,4 @@
     }
 
-    //orxout(verbose_more, context::network) << "Synchronisable: objectID_ " << syncHeader.getObjectID() << ", classID_ " << syncHeader.getClassID() << " size: " << syncHeader.getDataSize() << " synchronising data" << endl;
     if( !syncHeaderLight.isDiffed() )
     {
@@ -357,9 +349,7 @@
     {
       mem += SynchronisableHeaderLight::getSize();
-//       orxout(debug_output, context::network) << "objectID: " << this->objectID_ << endl;
       while( mem < data+syncHeaderLight.getDataSize()+SynchronisableHeaderLight::getSize() )
       {
         VariableID varID = *(VariableID*)mem;
-//         orxout(debug_output, context::network) << "varID: " << varID << endl;
         assert( varID < syncList_.size() );
         mem += sizeof(VariableID);
@@ -400,6 +390,4 @@
   bool Synchronisable::doSync(/*int32_t id,*/ uint8_t mode)
   {
-//     if(mode==0x0)
-//       mode=state_;
     assert(mode!=0x0);
     return ( (this->objectMode_ & mode)!=0 && (!syncList_.empty() ) );
Index: code/branches/Masterserver_FS18/src/libraries/network/synchronisable/Synchronisable.h
===================================================================
--- code/branches/Masterserver_FS18/src/libraries/network/synchronisable/Synchronisable.h	(revision 11982)
+++ code/branches/Masterserver_FS18/src/libraries/network/synchronisable/Synchronisable.h	(revision 11983)
@@ -134,9 +134,4 @@
         { memcpy(data_, h.data_, getSize()); }
   };
-  
-//   inline void operator=(SynchronisableHeaderLight& h1, SynchronisableHeader& h2)
-//   {
-//     memcpy(h1.data_, h2.data_, h1.getSize());
-//   }
 
   /**
