Index: branches/network/src/lib/network/network_game_manager.cc
===================================================================
--- branches/network/src/lib/network/network_game_manager.cc	(revision 6252)
+++ branches/network/src/lib/network/network_game_manager.cc	(revision 6256)
@@ -73,7 +73,9 @@
   byte b;
 
-  while ( i<length )
+  while ( i<length-1 )
   {
     b = data[i++];
+
+    PRINTF(0)("WriteBytes: b = %d\n", b);
 
     if ( isServer() )
@@ -92,6 +94,5 @@
       }
     }
-
-    if ( !isServer() )
+    else
     {
       if ( b == CREATE_ENTITY )
@@ -362,8 +363,12 @@
     return;
 
+  PRINTF(0)("SendEntityList: n = %d\n", networkStream->getSyncCount());
+
   while ( it != e )
   {
     if ( !writeToClientBuffer( outBuffer[userID], (*it)->getClassID() ) )
       return;
+
+    PRINTF(0)("SendEntityList: ClassID = %x\n", (*it)->getClassID());
 
     if ( !writeToClientBuffer( outBuffer[userID], (*it)->getUniqueID() ) )
@@ -409,6 +414,10 @@
   if ( !b )
   {
-    PRINTF(1)("Could not fabricate Object with classID %d\n", classID);
-    return;
+    PRINTF(1)("Could not fabricate Object with classID %x\n", classID);
+    return;
+  }
+  else
+  {
+    PRINTF(0)("Fabricated entity: %s\n", b->getClassName());
   }
 
@@ -422,5 +431,5 @@
   else
   {
-    PRINTF(1)("Class with ID %d is not a synchronizeable!", (int)classID);
+    PRINTF(1)("Class with ID %x is not a synchronizeable!", (int)classID);
     delete b;
   }
@@ -549,5 +558,5 @@
   }
   int classID;
-  i += Converter::byteArrayToInt( data, &classID );
+  i += Converter::byteArrayToInt( &data[i], &classID );
 
   createEntity( (ClassID)classID );
@@ -564,5 +573,5 @@
   }
   int uniqueID;
-  i += Converter::byteArrayToInt( data, &uniqueID );
+  i += Converter::byteArrayToInt( &data[i], &uniqueID );
 
   removeEntity( uniqueID );
@@ -579,5 +588,5 @@
   }
   int classID;
-  i += Converter::byteArrayToInt( data, &classID );
+  i += Converter::byteArrayToInt( &data[i], &classID );
 
   if ( INTSIZE > length-i )
@@ -587,5 +596,5 @@
   }
   int uniqueID;
-  i += Converter::byteArrayToInt( data, &uniqueID );
+  i += Converter::byteArrayToInt( &data[i], &uniqueID );
 
   if ( INTSIZE > length-i )
@@ -595,5 +604,5 @@
   }
   int owner;
-  i += Converter::byteArrayToInt( data, &owner );
+  i += Converter::byteArrayToInt( &data[i], &owner );
 
   doCreateEntity( (ClassID)classID, uniqueID, owner );
@@ -610,5 +619,5 @@
   }
   int uniqueID;
-  i += Converter::byteArrayToInt( data, &uniqueID );
+  i += Converter::byteArrayToInt( &data[i], &uniqueID );
 
   doRemoveEntity( uniqueID );
@@ -624,6 +633,12 @@
     return false;
   }
+
+  PRINTF(0)("HandleCreateEntityList:  data[i..i+3] = %d %d %d %d\n", data[i], data[i+1], data[i+2], data[i+3]);
+
   int n;
-  i += Converter::byteArrayToInt( data, &n );
+  i += Converter::byteArrayToInt( &data[i], &n );
+
+
+  PRINTF(0)("HandleCreateEntityList: n = %d\n", n);
 
   int classID, uniqueID, owner;
@@ -637,5 +652,5 @@
       return false;
     }
-    i += Converter::byteArrayToInt( data, &classID );
+    i += Converter::byteArrayToInt( &data[i], &classID );
 
     if ( INTSIZE > length-i )
@@ -644,5 +659,5 @@
       return false;
     }
-    i += Converter::byteArrayToInt( data, &uniqueID );
+    i += Converter::byteArrayToInt( &data[i], &uniqueID );
 
     if ( INTSIZE > length-i )
@@ -651,5 +666,5 @@
       return false;
     }
-    i += Converter::byteArrayToInt( data, &owner );
+    i += Converter::byteArrayToInt( &data[i], &owner );
 
     doCreateEntity( (ClassID)classID, uniqueID, owner );
@@ -667,5 +682,5 @@
   }
   int n;
-  i += Converter::byteArrayToInt( data, &n );
+  i += Converter::byteArrayToInt( &data[i], &n );
 
   int uniqueID;
@@ -679,5 +694,5 @@
       return false;
     }
-    i += Converter::byteArrayToInt( data, &uniqueID );
+    i += Converter::byteArrayToInt( &data[i], &uniqueID );
 
     doRemoveEntity( uniqueID );
@@ -696,5 +711,5 @@
 
   int uniqueID;
-  i += Converter::byteArrayToInt( data, &uniqueID );
+  i += Converter::byteArrayToInt( &data[i], &uniqueID );
 
   doYouAre( uniqueID );
@@ -711,5 +726,5 @@
   }
   int uniqueID;
-  i += Converter::byteArrayToInt( data, &uniqueID );
+  i += Converter::byteArrayToInt( &data[i], &uniqueID );
 
   doRequestSync( uniqueID, sender );
@@ -733,5 +748,5 @@
 bool NetworkGameManager::writeToClientBuffer( clientBuffer & cb, int i )
 {
-  int n = Converter::intToByteArray( i, cb.buffer, cb.maxLength-cb.length );
+  int n = Converter::intToByteArray( i, cb.buffer+cb.length, cb.maxLength-cb.length );
   cb.length += n;
 
Index: branches/network/src/lib/network/network_socket.cc
===================================================================
--- branches/network/src/lib/network/network_socket.cc	(revision 6252)
+++ branches/network/src/lib/network/network_socket.cc	(revision 6256)
@@ -21,4 +21,5 @@
 #define DEBUG_MODULE_NETWORK
 
+#include "converter.h"
 
 /* include your own header */
@@ -398,13 +399,10 @@
 {
   PRINTF(5)("NetworkSocket::writePacket()\n");
-  if (length>255)
-  {
-    PRINTF(1)("Packet length > 255!\n");
-    return false;
-  }
-
-  byte blen = length;
-
-  writeBytes(&blen, 1);
+
+  byte blen[INTSIZE];
+
+  Converter::intToByteArray( length, blen, INTSIZE );
+
+  writeBytes(blen, INTSIZE);
   writeBytes(data, length);
 }
@@ -413,10 +411,11 @@
 {
   PRINTF(5)("NetworkSocket::readPacket()\n");
-  if (incomingBufferLength<1)
-  {
-    return 0;
-  }
-
-  byte blen = incomingBuffer[0];
+  if (incomingBufferLength<INTSIZE)
+  {
+    return 0;
+  }
+
+  int blen;
+  Converter::byteArrayToInt( incomingBuffer, &blen );
 
   if (blen>maxLength)
@@ -431,5 +430,6 @@
   }
 
-  readBytes(&blen, 1);
+  byte t[INTSIZE];
+  readBytes(t, INTSIZE);
   int res = readBytes(data, blen);
 
Index: branches/network/src/lib/network/network_stream.cc
===================================================================
--- branches/network/src/lib/network/network_stream.cc	(revision 6252)
+++ branches/network/src/lib/network/network_stream.cc	(revision 6256)
@@ -262,8 +262,4 @@
       } while( reciever!=0 );
     }
-    else
-    {
-      PRINTF(0)("synchronizeables == NULL");
-    }
   }
 
