Index: trunk/src/lib/network/network_game_manager.cc
===================================================================
--- trunk/src/lib/network/network_game_manager.cc	(revision 6341)
+++ trunk/src/lib/network/network_game_manager.cc	(revision 6424)
@@ -23,4 +23,7 @@
 #include "network_stream.h"
 #include "converter.h"
+
+#include "p_node.h"
+
 
 /* include your own header */
@@ -237,5 +240,5 @@
  * @param classID: The ID of the class of which an entity should be created
  */
-BaseObject* NetworkGameManager::createEntity( TiXmlElement* element)
+BaseObject* NetworkGameManager::createEntity(const TiXmlElement* element)
 {
   if ( this->isServer() )
@@ -252,5 +255,5 @@
     if ( !b )
     {
-      PRINTF(1)("Could not fabricate Object with classID %x\n", element->Value() );
+      PRINTF(1)("Could not fabricate Object with className %s\n", element->Value() );
       return NULL;
     }
@@ -391,4 +394,6 @@
   //PRINTF(0)("SendEntityList: n = %d\n", networkStream->getSyncCount()-2 );
 
+  int n = 0;
+
   while ( it != e )
   {
@@ -403,4 +408,18 @@
     if ( !writeToClientBuffer( outBuffer[userID], (int)((*it)->getOwner()) ) )
       return;
+
+
+    PRINTF(0)("id = %x %s %s\n", (int)((*it)->getLeafClassID()), (*it)->getClassName(), (*it)->getName());
+
+
+    /*if ( (*it)->isA(CL_WORLD_ENTITY) )
+    {
+      n = dynamic_cast<WorldEntity*>((*it))->readState( outBuffer[userID].buffer, outBuffer[userID].maxLength-outBuffer[userID].length );
+      if ( n = 0 )
+      {
+        PRINTF(2)("n = 0\n");
+      }
+      outBuffer[userID].length += n;
+  }*/
 
     it++;
@@ -436,5 +455,5 @@
  * @param owner: owner of this synchronizealbe
  */
-void NetworkGameManager::doCreateEntity( ClassID classID, int uniqueID, int owner )
+BaseObject* NetworkGameManager::doCreateEntity( ClassID classID, int uniqueID, int owner )
 {
   BaseObject * b = Factory::fabricate( classID );
@@ -443,5 +462,5 @@
   {
     PRINTF(1)("Could not fabricate Object with classID %x\n", classID);
-    return;
+    return NULL;
   }
 
@@ -455,4 +474,5 @@
       s->setIsOutOfSync( true );
     PRINTF(0)("Fabricated %s with id %d\n", s->getClassName(), s->getUniqueID());
+    return b;
   }
   else
@@ -461,4 +481,5 @@
     delete b;
   }
+  return NULL;
 }
 
@@ -695,8 +716,22 @@
     i += Converter::byteArrayToInt( &data[i], &owner );
 
+    PRINTF(0)("before fabricate\n");
     if ( classID != CL_NETWORK_GAME_MANAGER && classID != CL_HANDSHAKE )
-      doCreateEntity( (ClassID)classID, uniqueID, owner );
-
-  }
+    {
+      BaseObject* b = doCreateEntity( (ClassID)classID, uniqueID, owner );
+
+      /*if ( b != NULL )
+      {
+        if ( b->isA(CL_WORLD_ENTITY) )
+        {
+          int n = dynamic_cast<WorldEntity*>(b)->writeState( data, length, sender );
+
+          i += n;
+        }
+    }*/
+    }
+
+  }
+
   return true;
 }
Index: trunk/src/lib/network/network_game_manager.h
===================================================================
--- trunk/src/lib/network/network_game_manager.h	(revision 6341)
+++ trunk/src/lib/network/network_game_manager.h	(revision 6424)
@@ -75,5 +75,5 @@
 
     void createEntity( ClassID classID, int owner = 0 );
-    BaseObject* createEntity( TiXmlElement* element);
+    BaseObject* createEntity(const TiXmlElement* element);
     void removeEntity( int uniqueID );
     void sendYouAre( int uniqueID, int userID );
@@ -94,5 +94,5 @@
     void executeRequestSync( int uniqueID, int user );
 
-    void doCreateEntity(ClassID classID, int uniqueID, int owner);
+    BaseObject* doCreateEntity(ClassID classID, int uniqueID, int owner);
     void doRemoveEntity(int uniqueID);
     void doRequestSync(int uniqueID, int userID);
Index: trunk/src/lib/network/synchronizeable.cc
===================================================================
--- trunk/src/lib/network/synchronizeable.cc	(revision 6341)
+++ trunk/src/lib/network/synchronizeable.cc	(revision 6424)
@@ -36,4 +36,5 @@
   this->networkStream = NULL;
   this->setRequestedSync( false );
+  this->setIsOutOfSync( !(this->isServer()) );
 }
 
