Index: code/trunk/src/libraries/network/synchronisable/Synchronisable.cc
===================================================================
--- code/trunk/src/libraries/network/synchronisable/Synchronisable.cc	(revision 7401)
+++ code/trunk/src/libraries/network/synchronisable/Synchronisable.cc	(revision 7801)
@@ -123,5 +123,10 @@
   {
     SynchronisableHeader header(mem);
-    assert( !header.isDiffed() );
+    if( header.isDiffed() )
+    {
+      mem += header.getDataSize() + header.getSize();
+      return 0;
+    }
+//     assert( !header.isDiffed() );
 
     COUT(4) << "fabricating object with id: " << header.getObjectID() << std::endl;
@@ -217,9 +222,9 @@
    * length of varx: size saved int syncvarlist
    * @param mem pointer to allocated memory with enough size
-   * @param sizes FIXME - add doc!
+   * @param sizes vector containing sizes of all objects in gamestate (to be appended)
    * @param id gamestateid of the gamestate to be saved (important for priorities)
    * @param mode defines the direction in which the data will be send/received
    *             0x1: server->client
-   *             0x2: client->server (not recommended)
+   *             0x2: client->server
    *             0x3: bidirectional
    * @return true: if !doSync or if everything was successfully saved
@@ -265,4 +270,5 @@
       //tempsize += (*i)->getSize( mode );
     }
+    assert(tempsize!=0);  // if this happens an empty object (with no variables) would be transmitted
 //     COUT(4) << endl;
 
@@ -316,5 +322,5 @@
       mem += SynchronisableHeader::getSize();
       std::vector<SynchronisableVariableBase *>::iterator i;
-      for(i=syncList_.begin(); i!=syncList_.end(); i++)
+      for(i=syncList_.begin(); i!=syncList_.end(); ++i)
       {
         assert( mem <= data+syncHeader2.getDataSize()+SynchronisableHeader::getSize() ); // always make sure we don't exceed the datasize in our stream
Index: code/trunk/src/libraries/network/synchronisable/Synchronisable.h
===================================================================
--- code/trunk/src/libraries/network/synchronisable/Synchronisable.h	(revision 7401)
+++ code/trunk/src/libraries/network/synchronisable/Synchronisable.h	(revision 7801)
@@ -65,50 +65,4 @@
     };
   }
-  
-  typedef uint8_t VariableID;
-
-  /**
-   * @brief: stores information about a Synchronisable
-   *
-   * This class stores the information about a Synchronisable (objectID_, classID_, creatorID_, dataSize)
-   * in an emulated bitset.
-   * Bit 1 to 31 store the size of the Data the synchronisable consumes in the stream
-   * Bit 32 is a bool and defines whether the variables are stored in diff mode
-   * Byte 5 to 8: objectID_
-   * Byte 9 to 12: classID_
-   * Byte 13 to 16: creatorID_
-   */
-  class _NetworkExport SynchronisableHeader{
-    friend class SynchronisableHeaderLight;
-    private:
-      uint8_t* data_;
-    public:
-      SynchronisableHeader(uint8_t* data)
-        { data_ = data; }
-      inline static uint32_t getSize()
-        { return 14; }
-      inline uint16_t getDataSize() const
-        { return (*(uint16_t*)data_) & 0x7FFF; } //only use the first 15 bits
-      inline void setDataSize(uint16_t size)
-        { *(uint16_t*)(data_) = (size & 0x7FFF) | (*(uint16_t*)(data_) & 0x8000 ); }
-      inline bool isDiffed() const
-        { return ( (*(uint16_t*)data_) & 0x8000 ) == 0x8000; }
-      inline void setDiffed( bool b)
-        { *(uint16_t*)(data_) = (b << 15) | (*(uint16_t*)(data_) & 0x7FFF ); }
-      inline uint32_t getObjectID() const
-        { return *(uint32_t*)(data_+2); }
-      inline void setObjectID(uint32_t objectID_)
-        { *(uint32_t*)(data_+2) = objectID_; }
-      inline uint32_t getClassID() const
-        { return *(uint32_t*)(data_+6); }
-      inline void setClassID(uint32_t classID_)
-        { *(uint32_t*)(data_+6) = classID_; }
-      inline uint32_t getCreatorID() const
-        { return *(uint32_t*)(data_+10); }
-      inline void setCreatorID(uint32_t creatorID_)
-        { *(uint32_t*)(data_+10) = creatorID_; }
-      inline void operator=(SynchronisableHeader& h)
-        { memcpy(data_, h.data_, getSize()); }
-  };
 
     /**
@@ -121,6 +75,7 @@
    * Byte 5 to 8: objectID_
    */
-  class _NetworkExport SynchronisableHeaderLight{
-    private:
+  class _NetworkExport SynchronisableHeaderLight
+  {
+    protected:
       uint8_t* data_;
     public:
@@ -141,7 +96,44 @@
       inline void setObjectID(uint32_t objectID_)
         { *(uint32_t*)(data_+2) = objectID_; }
+      inline void operator=(SynchronisableHeaderLight& h)
+        { memcpy(data_, h.data_, SynchronisableHeaderLight::getSize()); }
+  };
+  
+  typedef uint8_t VariableID;
+  
+  /**
+   * @brief: stores information about a Synchronisable
+   *
+   * This class stores the information about a Synchronisable (objectID_, classID_, creatorID_, dataSize)
+   * in an emulated bitset.
+   * Bit 1 to 31 store the size of the Data the synchronisable consumes in the stream
+   * Bit 32 is a bool and defines whether the variables are stored in diff mode
+   * Byte 5 to 8: objectID_
+   * Byte 9 to 12: classID_
+   * Byte 13 to 16: creatorID_
+   */
+  class _NetworkExport SynchronisableHeader: public SynchronisableHeaderLight
+  {
+    public:
+      SynchronisableHeader(uint8_t* data): SynchronisableHeaderLight(data)
+        {}
+      inline static uint32_t getSize()
+        { return SynchronisableHeaderLight::getSize()+8; }
+      inline uint32_t getClassID() const
+        { return *(uint32_t*)(data_+SynchronisableHeaderLight::getSize()); }
+      inline void setClassID(uint32_t classID_)
+        { *(uint32_t*)(data_+SynchronisableHeaderLight::getSize()) = classID_; }
+      inline uint32_t getCreatorID() const
+        { return *(uint32_t*)(data_+SynchronisableHeaderLight::getSize()+4); }
+      inline void setCreatorID(uint32_t creatorID_)
+        { *(uint32_t*)(data_+SynchronisableHeaderLight::getSize()+4) = creatorID_; }
       inline void operator=(SynchronisableHeader& h)
         { memcpy(data_, h.data_, getSize()); }
   };
+  
+//   inline void operator=(SynchronisableHeaderLight& h1, SynchronisableHeader& h2)
+//   {
+//     memcpy(h1.data_, h2.data_, h1.getSize());
+//   }
 
   /**
