Index: /code/branches/network/src/network/Client.cc
===================================================================
--- /code/branches/network/src/network/Client.cc	(revision 904)
+++ /code/branches/network/src/network/Client.cc	(revision 905)
@@ -203,4 +203,5 @@
     if(id!=NULL)
       id->setNetworkID(clid->clid);
+    COUT(4) << "received network id: " << clid->clid << "; classname: " << clid->message << std::endl;
     return;
   }
Index: /code/branches/network/src/network/ConnectionManager.cc
===================================================================
--- /code/branches/network/src/network/ConnectionManager.cc	(revision 904)
+++ /code/branches/network/src/network/ConnectionManager.cc	(revision 905)
@@ -257,24 +257,19 @@
 
   void ConnectionManager::syncClassid(int clientID) {
-    int i=0;
+    unsigned int network_id=0;
     std::string classname;
-    bool abort=false;
     orxonox::Identifier *id;
-    while(!abort){
-      id = ID(i);
-      std::cout << "syncid: " << i << ", ID(id): " << id << std::endl;
-      if(id == NULL){
-        if(i!=0)
-          abort=true;
-        else{
-          ++i;
-          continue;
-        }
-      }
-      else{
-        classname = id->getName();
-        addPacket(packet_gen.clid( i, classname ),clientID);
-      }
-      ++i;
+    std::map<std::string, orxonox::Identifier*>::const_iterator it = orxonox::Factory::getFactoryBegin();
+    while(it != orxonox::Factory::getFactoryEnd()){
+      id = (*it).second;
+      if(id == NULL)
+        continue;
+      classname = id->getName();
+      network_id = id->getNetworkID();
+      COUT(4) << "network_id: " << network_id << ", classname: " << classname << std::endl;
+      
+      addPacket(packet_gen.clid( (int)network_id, classname ), clientID);
+      
+      ++it;
     }
     sendPackets();
Index: /code/branches/network/src/network/GameStateClient.cc
===================================================================
--- /code/branches/network/src/network/GameStateClient.cc	(revision 904)
+++ /code/branches/network/src/network/GameStateClient.cc	(revision 905)
@@ -41,7 +41,7 @@
   bool GameStateClient::pushGameState(GameStateCompressed *compstate) {
     if(compstate->diffed)
-      return loadSnapshot(decode(reference, *compstate));
+      return loadSnapshot(decode(reference, compstate));
     else
-      return loadSnapshot(decode(*compstate));
+      return loadSnapshot(decode(compstate));
   }
 
@@ -61,12 +61,12 @@
   * @param state a GameState struct containing the size of the gamestate and a pointer linking to a flat list (returned by getSnapshot)
   */
-  bool GameStateClient::loadSnapshot(GameState state) {
-    unsigned char *data=state.data;
-    std::cout << "loadSnapshot: loading gs: " << state.id << std::endl;
+  bool GameStateClient::loadSnapshot(GameState *state) {
+    unsigned char *data=state->data;
+    COUT(4) << "loadSnapshot: loading gs: " << state->id << std::endl;
     // get the start of the Synchronisable list
     orxonox::Iterator<Synchronisable> it=orxonox::ObjectList<Synchronisable>::start();
     syncData sync;
     // loop as long as we have some data ;)
-    while(data < state.data+state.size){
+    while(data < state->data+state->size){
       // prepare the syncData struct
       sync.length = (int)*data;
@@ -82,10 +82,11 @@
         // bad luck ;)
         // delete the synchronisable (obviously seems to be deleted on the server)
-        while(it && it->objectID!=sync.objectID){
+        while(it && it->objectID!=sync.objectID)
           removeObject(it);
-        }
-        if(it==0){
-          std::cout << "classid: " << sync.classID << ", name: " << ID(sync.classID)->getName() << std::endl;
-          Synchronisable *no = (Synchronisable*)(ID(sync.classID)->fabricate());
+        
+        
+        if(!it){
+          COUT(5) << "classid: " << sync.classID << ", name: " << ID((unsigned int) sync.classID)->getName() << std::endl;
+          Synchronisable *no = (Synchronisable*)(ID((unsigned int) sync.classID)->fabricate());
           no->objectID=sync.objectID;
           no->classID=sync.classID;
@@ -93,5 +94,5 @@
           // update data and create object/entity...
           if( !no->updateData(sync) && !no->create() )
-            COUT(0) << "We couldn't create/update the object: " << sync.objectID << std::endl;
+            COUT(1) << "We couldn't create/update the object: " << sync.objectID << std::endl;
           ++it;
         }
@@ -99,5 +100,5 @@
         // we have our object
         if(! it->updateData(sync))
-          std::cout << "We couldn't update objectID: " \
+          COUT(1) << "We couldn't update objectID: " \
           << sync.objectID << "; classID: " << sync.classID << std::endl;
       }
@@ -108,20 +109,20 @@
   }
 
-  GameState GameStateClient::diff(GameState a, GameState b) {
-    unsigned char *ap = a.data, *bp = b.data;
+  GameState *GameStateClient::undiff(GameState *a, GameState *b) {
+    unsigned char *ap = a->data, *bp = b->data;
     int of=0; // pointers offset
     int dest_length=0;
-    if(a.size>=b.size)
-      dest_length=a.size;
+    if(a->size>=b->size)
+      dest_length=a->size;
     else
-      dest_length=b.size;
+      dest_length=b->size;
     unsigned char *dp = (unsigned char *)malloc(dest_length*sizeof(unsigned char));
-    while(of<a.size && of<b.size){
+    while(of<a->size && of<b->size){
       *(dp+of)=*(ap+of)^*(bp+of); // do the xor
       ++of;
     }
-    if(a.size!=b.size){ // do we have to fill up ?
+    if(a->size!=b->size){ // do we have to fill up ?
       unsigned char n=0;
-      if(a.size<b.size){
+      if(a->size<b->size){
         while(of<dest_length){
           *(dp+of)=n^*(bp+of);
@@ -137,11 +138,15 @@
     // should be finished now
     // FIXME: is it true or false now? (struct has changed, producing warnings)
-    GameState r = {b.id, dest_length, true, dp};
+    GameState *r = new GameState;
+    r->id = b->id;
+    r->size = dest_length;
+    r->diffed = false;
+    r->data = dp;
     return r;
   }
 
-  GameState GameStateClient::decompress(GameStateCompressed a) {
-    int normsize = a.normsize;
-    int compsize = a.compsize;
+  GameState *GameStateClient::decompress(GameStateCompressed *a) {
+    int normsize = a->normsize;
+    int compsize = a->compsize;
     int bufsize;
     if(normsize < compsize)
@@ -154,29 +159,32 @@
     //std::cout << "gamestateclient" << std::endl;
     //std::cout << "normsize " << a.normsize << " compsize " << a.compsize << " " << bufsize << std::endl;
-    retval = uncompress( dest, &length, a.data, (uLong)compsize );
+    retval = uncompress( dest, &length, a->data, (uLong)compsize );
     //std::cout << "length " << length << std::endl;
     switch ( retval ) {
-      case Z_OK: std::cout << "successfully decompressed" << std::endl; break;
-      case Z_MEM_ERROR: std::cout << "not enough memory available" << std::endl; break;
-      case Z_BUF_ERROR: std::cout << "not enough memory available in the buffer" << std::endl; break;
-      case Z_DATA_ERROR: std::cout << "data corrupted" << std::endl; break;
+      case Z_OK: COUT(4) << "successfully decompressed" << std::endl; break;
+      case Z_MEM_ERROR: COUT(1) << "not enough memory available" << std::endl; return NULL;
+      case Z_BUF_ERROR: COUT(2) << "not enough memory available in the buffer" << std::endl; return NULL;
+      case Z_DATA_ERROR: COUT(2) << "data corrupted" << std::endl; return NULL;
     }
 
-    GameState gamestate;
-    gamestate.id = a.id;
-    gamestate.size = normsize;
-    gamestate.data = dest;
-    gamestate.diffed = a.diffed;
+    GameState *gamestate = new GameState;
+    gamestate->id = a->id;
+    gamestate->size = normsize;
+    gamestate->data = dest;
+    gamestate->diffed = a->diffed;
+    
+    delete a->data; //delete compressed data
+    delete a; //we do not need the old (struct) gamestate anymore
 
     return gamestate;
   }
 
-  GameState GameStateClient::decode(GameState a, GameStateCompressed x) {
-    GameState t = decompress(x);
-    return diff(a, t);
+  GameState *GameStateClient::decode(GameState *a, GameStateCompressed *x) {
+    GameState *t = decompress(x);
+    return undiff(a, t);
   }
 
-  GameState GameStateClient::decode(GameStateCompressed x) {
-    GameState t = decompress(x);
+  GameState *GameStateClient::decode(GameStateCompressed *x) {
+    GameState *t = decompress(x);
     return t;
   }
Index: /code/branches/network/src/network/GameStateClient.h
===================================================================
--- /code/branches/network/src/network/GameStateClient.h	(revision 904)
+++ /code/branches/network/src/network/GameStateClient.h	(revision 905)
@@ -25,12 +25,12 @@
     bool pushGameState(GameStateCompressed *compstate);
   private:
-    bool loadSnapshot(GameState state);
-    GameState diff(GameState a, GameState b);
-    GameState decompress(GameStateCompressed a);
-    GameState decode(GameState a, GameStateCompressed x);
-    GameState decode(GameStateCompressed x);
+    bool loadSnapshot(GameState *state);
+    GameState *undiff(GameState *a, GameState *b);
+    GameState *decompress(GameStateCompressed *a);
+    GameState *decode(GameState *a, GameStateCompressed *x);
+    GameState *decode(GameStateCompressed *x);
     void removeObject(orxonox::Iterator<Synchronisable> &it);
 
-    GameState reference;
+    GameState *reference;
   };
 
Index: /code/branches/network/src/network/GameStateManager.cc
===================================================================
--- /code/branches/network/src/network/GameStateManager.cc	(revision 904)
+++ /code/branches/network/src/network/GameStateManager.cc	(revision 905)
@@ -43,4 +43,5 @@
 
 #include "core/CoreIncludes.h"
+
 #include "ClientInformation.h"
 #include "Synchronisable.h"
Index: /code/branches/network/src/orxonox/Orxonox.cc
===================================================================
--- /code/branches/network/src/orxonox/Orxonox.cc	(revision 904)
+++ /code/branches/network/src/orxonox/Orxonox.cc	(revision 905)
@@ -107,6 +107,9 @@
         usleep(10);
 
+        if(mode_!=CLIENT){
         mKeyboard->capture();
         return !mKeyboard->isKeyDown(OIS::KC_ESCAPE);
+        }else
+          return true;
       }
 
@@ -225,5 +228,5 @@
     
     
-    setupInputSystem();
+    //setupInputSystem();
     
     createFrameListener();
