Index: branches/network/src/lib/lang/base_object.cc
===================================================================
--- branches/network/src/lib/lang/base_object.cc	(revision 6273)
+++ branches/network/src/lib/lang/base_object.cc	(revision 6275)
@@ -75,5 +75,4 @@
   this->classID |= (long)classID;
   this->className = className;
-  this->realClassID = classID;
 
   ClassList::addToClassList(this, classID, className);
Index: branches/network/src/lib/lang/base_object.h
===================================================================
--- branches/network/src/lib/lang/base_object.h	(revision 6273)
+++ branches/network/src/lib/lang/base_object.h	(revision 6275)
@@ -34,5 +34,5 @@
   /** @returns the classID of the corresponding Object */
   inline int getClassID() const { return this->classID; };
-  inline int getRealClassID() const { return this->realClassID; };
+  inline ClassID getLeafID() { return (ClassID)(this->classID & CL_MASK_LOWLEVEL_CLASS); }
 
   bool isA (ClassID classID) const;
@@ -50,5 +50,4 @@
     const char*        className;        //!< the name of the class
     long               classID;          //!< this is the id from the class_id.h enumeration
-    long               realClassID;      //!< classID which can be used with factory
     char*              objectName;       //!< The name of this object
 };
Index: branches/network/src/lib/network/converter.cc
===================================================================
--- branches/network/src/lib/network/converter.cc	(revision 6273)
+++ branches/network/src/lib/network/converter.cc	(revision 6275)
@@ -444,4 +444,5 @@
   {
     PRINTF(1)("There is not enough space in string (%d) to store %d bytes\n", maxLength, length+1 );
+    strncpy(s,"",maxLength);
     return -1;
   }
Index: branches/network/src/lib/network/data_stream.h
===================================================================
--- branches/network/src/lib/network/data_stream.h	(revision 6273)
+++ branches/network/src/lib/network/data_stream.h	(revision 6275)
@@ -13,5 +13,5 @@
 #include "netdefs.h"
 
-#define DATA_STREAM_BUFFER_SIZE 1024
+#define DATA_STREAM_BUFFER_SIZE 10240
 
 class DataStream : public BaseObject
Index: branches/network/src/lib/network/network_game_manager.cc
===================================================================
--- branches/network/src/lib/network/network_game_manager.cc	(revision 6273)
+++ branches/network/src/lib/network/network_game_manager.cc	(revision 6275)
@@ -236,4 +236,5 @@
     }
 
+
     if ( b->isA(CL_SYNCHRONIZEABLE) )
     {
@@ -372,8 +373,8 @@
   while ( it != e )
   {
-    if ( (*it)->getRealClassID() != CL_NETWORK_GAME_MANAGER && (*it)->getRealClassID() != CL_HANDSHAKE )
-    {
-
-      if ( !writeToClientBuffer( outBuffer[userID], (*it)->getRealClassID() ) )
+    if ( (*it)->getLeafID() != CL_NETWORK_GAME_MANAGER && (*it)->getLeafID() != CL_HANDSHAKE )
+    {
+
+      if ( !writeToClientBuffer( outBuffer[userID], (int)((*it)->getLeafID()) ) )
         return;
 
@@ -425,8 +426,4 @@
     PRINTF(1)("Could not fabricate Object with classID %x\n", classID);
     return;
-  }
-  else
-  {
-    //PRINTF(0)("Fabricated entity: %s\n", b->getClassName());
   }
 
@@ -439,4 +436,5 @@
     if ( !isServer() )
       s->setIsOutOfSync( true );
+    PRINTF(0)("Fabricated %s with id %d\n", s->getClassName(), s->getUniqueID());
   }
   else
Index: branches/network/src/lib/network/synchronizeable.h
===================================================================
--- branches/network/src/lib/network/synchronizeable.h	(revision 6273)
+++ branches/network/src/lib/network/synchronizeable.h	(revision 6275)
@@ -21,13 +21,103 @@
 #define STATE_REQUESTEDSYNC 4
 
+
 //macros to help writing data in byte buffer
-#define SYNCHELP_WRITE_BEGIN() {  int __synchelp_write_i = 0; \
-                                  bool __synchelp_write_err = false; \
-                                  int __synchelp_write_n; }
+/*
+ * Important: these macros must be used in
+ *     SYNCHELP_READ_*:  virtual void      writeBytes(const byte* data, int length, int sender);
+ *     SYNCHELP_WRITE_*: virtual int       readBytes(byte* data, int maxLength, int * reciever);
+ * with the same argument names!
+ *
+ *
+ * Example 1:
+ *  SYNCHELP_READ_BEGIN();
+ *  SYNCHELP_READ_FLOAT(size);
+ *  SYNCHELP_READ_STRING( textureName, 1024 ); //1024 is the length of textureName
+ *
+ * Example 2:
+ *  SYNCHELP_WRITE_BEGIN();
+ *  SYNCHELP_WRITE_FLOAT(this->size);
+ *  SYNCHELP_WRITE_STRING(this->textureName);
+ *  return SYNCHELP_WRITE_N;
+ *
+ */
+#define SYNCHELP_WRITE_BEGIN()    int __synchelp_write_i = 0; \
+                                  int __synchelp_write_n
 #define SYNCHELP_WRITE_RESET() { __synchelp_write_i = 0; __synchelp_write_err = false; }
-#define SYNCHELP_WRITE_INT(i) { __synchelp_write_n =  }
-#define SYNCHELP_WIRTE_FLOAT()
-#define SYNCHELP_WRITE_BYTE()
-#define SYNCHELP_WRITE_STRING()
+#define SYNCHELP_WRITE_INT(i) { __synchelp_write_n = \
+                                Converter::intToByteArray( i, data+__synchelp_write_i, maxLength-__synchelp_write_i ); \
+                                if ( __synchelp_write_n <= 0) \
+{ \
+                                  PRINTF(1)("Buffer is too small to store a int\n"); \
+                                  return 0; \
+} \
+                                __synchelp_write_i += __synchelp_write_n; \
+}
+#define SYNCHELP_WRITE_FLOAT(f) { __synchelp_write_n = \
+                                Converter::floatToByteArray( f, data+__synchelp_write_i, maxLength-__synchelp_write_i ); \
+                                if ( __synchelp_write_n <= 0) \
+{ \
+                                  PRINTF(1)("Buffer is too small to store a float\n"); \
+                                  return 0; \
+} \
+                                __synchelp_write_i += __synchelp_write_n; \
+}
+#define SYNCHELP_WRITE_BYTE(b) { \
+                                if (maxLength - __synchelp_write_i < 1) \
+{ \
+                                  PRINTF(1)("Buffer is too small to store string\n"); \
+                                  return 0; \
+} \
+                                data[__synchelp_write_i] = b; \
+                                __synchelp_write_i++; \
+}
+#define SYNCHELP_WRITE_STRING(s) { __synchelp_write_n = \
+                                Converter::stringToByteArray( s, data+__synchelp_write_i, strlen(s), maxLength-__synchelp_write_i ); \
+                                if ( __synchelp_write_n <= 0) \
+{ \
+                                  PRINTF(1)("Buffer is too small to store string\n"); \
+                                  return 0; \
+} \
+                                __synchelp_write_i += __synchelp_write_n; \
+}
+#define SYNCHELP_WRITE_N __synchelp_write_i
+
+
+#define SYNCHELP_READ_BEGIN()     int __synchelp_read_i = 0; \
+                                  int __synchelp_read_n
+
+#define SYNCHELP_READ_INT(i)       { \
+                                    if ( length-__synchelp_read_i < INTSIZE ) \
+{ \
+                                      PRINTF(1)("There is not enough data to read an int\n");  \
+                                      return; \
+} \
+                                    __synchelp_read_i += Converter::byteArrayToInt( data+__synchelp_read_i, &i );  \
+}
+#define SYNCHELP_READ_FLOAT(f)    { \
+                                    if ( length-__synchelp_read_i < FLOATSIZE ) \
+{ \
+                                      PRINTF(1)("There is not enough data to read a flaot\n");  \
+                                      return; \
+} \
+                                    __synchelp_read_i += Converter::byteArrayToFloat( data+__synchelp_read_i, &f );  \
+}
+#define SYNCHELP_READ_STRING(s,l)    { \
+                                    __synchelp_read_n = Converter::byteArrayToString( data+__synchelp_read_i, s, l );  \
+                                    if ( __synchelp_read_n <0 )  \
+{ \
+                                      PRINTF(1)("There is not enough data to read string\n");  \
+                                      return; \
+} \
+}
+#define SYNCHELP_READ_BYTE(b)      { \
+                                    if ( length-__synchelp_read_i < 1 ) \
+{ \
+                                      PRINTF(1)("There is not enough data to read a byte\n");  \
+                                      return; \
+} \
+                                    b = data[__synchelp_read_i]; \
+                                    __synchelp_read_i ++;  \
+}
 
 class NetworkStream;
