Index: branches/network/src/lib/network/network_game_manager.cc
===================================================================
--- branches/network/src/lib/network/network_game_manager.cc	(revision 6502)
+++ branches/network/src/lib/network/network_game_manager.cc	(revision 6503)
@@ -52,10 +52,4 @@
   this->setClassID(CL_NETWORK_GAME_MANAGER, "NetworkGameManager");
 
-  allOutBuffer.length = 0;
-
-  allOutBuffer.maxLength = 10*1024;
-
-  allOutBuffer.buffer = new byte[10*1024];
-
   newUniqueID = MAX_CONNECTIONS + 2;
 
@@ -74,6 +68,4 @@
   }
 
-  if ( allOutBuffer.buffer )
-    delete allOutBuffer.buffer;
 }
 
@@ -107,4 +99,5 @@
       if ( b == CREATE_ENTITY )
       {
+        PRINTF(0)("CREATE_ENTITY\n");
         if ( !handleCreateEntity( i, data, length, sender ) )
           return i;
@@ -188,19 +181,5 @@
   }
 
-  *reciever = 0;
-  int nbytes = allOutBuffer.length;
-  allOutBuffer.length = 0;
-
-  if ( nbytes <=0 )
-    return 0;
-
-  if ( nbytes > maxLength )
-  {
-    PRINTF(1)("OutBuffer.length (%d) > (%d) networkStreamBuffer.length\n", nbytes, maxLength);
-    return 0;
-  }
-
-  memcpy( data, allOutBuffer.buffer, nbytes );
-  return nbytes;
+  return 0;
 }
 
@@ -221,5 +200,4 @@
 int NetworkGameManager::createEntity( ClassID classID, int owner )
 {
-
   if ( this->isServer() )
   {
@@ -254,5 +232,4 @@
       return NULL;
     }
-    newUniqueID++;
 
     BaseObject * b = Factory::fabricate( element );
@@ -268,5 +245,5 @@
     {
       Synchronizeable * s = dynamic_cast<Synchronizeable*>(b);
-      s->setUniqueID( newUniqueID );
+      s->setUniqueID( newUniqueID++ );
       s->setOwner( 0 );
       this->networkStream->connectSynchronizeable( *s );
@@ -313,8 +290,14 @@
 void NetworkGameManager::requestCreateEntity(ClassID classID)
 {
-  if ( !writeToClientBuffer( allOutBuffer, (byte)REQUEST_CREATE ) )
-    return;
-  if ( !writeToClientBuffer( allOutBuffer, (int)classID ) )
-    return;
+  for ( int i = 0; i<outBuffer.size(); i++)
+  {
+    if ( !this->networkStream->isUserIdActive( i ) )
+      continue;
+
+    if ( !writeToClientBuffer( outBuffer[i], (byte)REQUEST_CREATE ) )
+      return;
+    if ( !writeToClientBuffer( outBuffer[i], (int)classID ) )
+      return;
+  }
 }
 
@@ -325,8 +308,14 @@
 void NetworkGameManager::requestRemoveEntity(int uniqueID)
 {
-  if ( !writeToClientBuffer( allOutBuffer, (byte)REQUEST_REMOVE ) )
-    return;
-  if ( !writeToClientBuffer( allOutBuffer, uniqueID ) )
-    return;
+  for ( int i = 0; i<outBuffer.size(); i++)
+  {
+    if ( !this->networkStream->isUserIdActive( i ) )
+      continue;
+
+    if ( !writeToClientBuffer( outBuffer[i], (byte)REQUEST_REMOVE ) )
+      return;
+    if ( !writeToClientBuffer( outBuffer[i], uniqueID ) )
+      return;
+  }
 }
 
@@ -338,12 +327,18 @@
 int NetworkGameManager::executeCreateEntity(ClassID classID, int uniqueID, int owner)
 {
-  if ( !writeToClientBuffer( allOutBuffer, (byte)CREATE_ENTITY ) )
-    return -1;
-  if ( !writeToClientBuffer( allOutBuffer, (int)classID ) )
-    return -1;
-  if ( !writeToClientBuffer( allOutBuffer, uniqueID ) )
-    return -1;
-  if ( !writeToClientBuffer( allOutBuffer, owner ) )
-    return -1;
+  for ( int i = 0; i<outBuffer.size(); i++)
+  {
+    if ( !this->networkStream->isUserIdActive( i ) )
+      continue;
+
+    if ( !writeToClientBuffer( outBuffer[i], (byte)CREATE_ENTITY ) )
+      return -1;
+    if ( !writeToClientBuffer( outBuffer[i], (int)classID ) )
+      return -1;
+    if ( !writeToClientBuffer( outBuffer[i], uniqueID ) )
+      return -1;
+    if ( !writeToClientBuffer( outBuffer[i], owner ) )
+      return -1;
+  }
 
   doCreateEntity( classID, uniqueID, owner );
@@ -359,8 +354,14 @@
 void NetworkGameManager::executeRemoveEntity(int uniqueID)
 {
-  if ( !writeToClientBuffer( allOutBuffer, (byte)REMOVE_ENTITY ) )
-    return;
-  if ( !writeToClientBuffer( allOutBuffer, uniqueID ) )
-    return;
+  for ( int i = 0; i<outBuffer.size(); i++)
+  {
+    if ( !this->networkStream->isUserIdActive( i ) )
+      continue;
+
+    if ( !writeToClientBuffer( outBuffer[i], (byte)REMOVE_ENTITY ) )
+      return;
+    if ( !writeToClientBuffer( outBuffer[i], uniqueID ) )
+      return;
+  }
 
   doRemoveEntity(uniqueID);
@@ -406,5 +407,5 @@
   while ( it != e )
   {
-
+    PRINTF(5)("SENDING ENTITY %s id %d\n", (*it)->getClassName(), (*it)->getUniqueID() );
     if ( !writeToClientBuffer( outBuffer[userID], (int)((*it)->getLeafClassID()) ) )
       return;
@@ -426,4 +427,6 @@
 bool NetworkGameManager::signalNewPlayer(int userId)
 {
+  if ( userId >= outBuffer.size() )
+    resizeBufferVector( userId );
 
   /* create new playable for Player*/
Index: branches/network/src/lib/network/network_game_manager.h
===================================================================
--- branches/network/src/lib/network/network_game_manager.h	(revision 6502)
+++ branches/network/src/lib/network/network_game_manager.h	(revision 6503)
@@ -122,5 +122,5 @@
   private:
     std::vector<clientBuffer>     outBuffer;
-    clientBuffer                  allOutBuffer;
+    //clientBuffer                  allOutBuffer;
     static NetworkGameManager*    singletonRef;
 
Index: branches/network/src/lib/network/network_stream.cc
===================================================================
--- branches/network/src/lib/network/network_stream.cc	(revision 6502)
+++ branches/network/src/lib/network/network_stream.cc	(revision 6503)
@@ -78,4 +78,5 @@
   this->connectionMonitor = new ConnectionMonitor();
   this->networkSockets.push_back( NULL );
+  this->networkSockets[0] = NULL; //TODO: remove this
   this->handshakes.push_back( NULL );
   this->bActive = true;
@@ -266,5 +267,5 @@
             if ( networkSockets[i] != NULL )
             {
-              PRINTF(5)("write %d bytes to socket %d\n", dataLength, reciever);
+              PRINTF(5)("write %d bytes to socket %d\n", dataLength, i);
               networkSockets[i]->writePacket(downBuffer, dataLength);
             }
Index: branches/network/src/lib/network/network_stream.h
===================================================================
--- branches/network/src/lib/network/network_stream.h	(revision 6502)
+++ branches/network/src/lib/network/network_stream.h	(revision 6503)
@@ -55,4 +55,6 @@
     inline int getSyncCount(){ return synchronizeables.size(); }
 
+    inline bool isUserIdActive( int userID ) { if (userID>=networkSockets.size()) return false; else return networkSockets[userID]!=NULL; }
+
   private:
     NetworkProtocol*       networkProtocol;
Index: branches/network/src/world_entities/space_ships/space_ship.cc
===================================================================
--- branches/network/src/world_entities/space_ships/space_ship.cc	(revision 6502)
+++ branches/network/src/world_entities/space_ships/space_ship.cc	(revision 6503)
@@ -539,4 +539,6 @@
   }
 
+  return SYNCHELP_READ_N;
+
   if ( b == DATA_flags && this->getHostID()!=this->getOwner() )
   {
@@ -591,4 +593,5 @@
   }
 
+  return 0;
 
   *reciever = 0;
