Index: code/branches/network3/src/network/GameStateClient.cc
===================================================================
--- code/branches/network3/src/network/GameStateClient.cc	(revision 1199)
+++ code/branches/network3/src/network/GameStateClient.cc	(revision 1200)
@@ -133,5 +133,5 @@
           orxonox::Identifier* id = ID((unsigned int)sync.classID);
           if(!id){
-            COUT(4) << "We could not identify a new object" << std::endl;
+            COUT(4) << "We could not identify a new object; classid: " << sync.classID << std::endl;
             continue;
           }
@@ -192,5 +192,5 @@
     r->id = diff->id;
     r->size = dest_length;
-    r->base_id = diff->base_id;
+    r->base_id = old->id;
     r->diffed = false;
     r->data = dp;
@@ -236,4 +236,5 @@
     gamestate->size = normsize;
     gamestate->data = dest;
+    gamestate->base_id = a->base_id;
     gamestate->diffed = a->diffed;
 
@@ -252,11 +253,11 @@
 
   GameState *GameStateClient::decode(GameStateCompressed *x) {
-    //GameState *t = decompress(x);
-    GameState *t = new GameState;
+    GameState *t = decompress(x);
+    /*GameState *t = new GameState;
     t->base_id = x->base_id;
     t->id = x->id;
     t->diffed = x->diffed;
     t->data = x->data;
-    t->size = x->normsize;
+    t->size = x->normsize;*/
     return t;
   }
Index: code/branches/network3/src/network/GameStateManager.cc
===================================================================
--- code/branches/network3/src/network/GameStateManager.cc	(revision 1199)
+++ code/branches/network3/src/network/GameStateManager.cc	(revision 1200)
@@ -79,4 +79,6 @@
     std::map<int,int>::iterator it = gameStateUsed.begin();
     while(it!=gameStateUsed.end()){
+      if((id_-(*it).first)<KEEP_GAMESTATES)
+        break;
       if( (*it).second <= 0 ){
         COUT(4) << "GameStateManager: deleting gamestate with id: " << (*it).first << ", uses: " << (*it).second << std::endl;
@@ -86,8 +88,8 @@
         gameStateUsed.erase(it++);
         continue;
-      }else if(id_-it->first<=KEEP_GAMESTATES){  //as soon as we got a used gamestate break here because we could use newer gamestates in future but only if we do not exceed KEEP_GAMESTATES # of gamestates in cache
+      }/*else if(id_-it->first<=KEEP_GAMESTATES){  //as soon as we got a used gamestate break here because we could use newer gamestates in future but only if we do not exceed KEEP_GAMESTATES # of gamestates in cache
         COUT(4) << "breaking " << std::endl;
         break;
-      }
+      }*/
       it++;
     }
@@ -114,5 +116,5 @@
       COUT(4) << "we got a GAMESTATEID_INITIAL for clientID: " << clientID << std::endl;
       GameState *server = reference;
-      ackGameState(clientID, reference->id);
+//       ackGameState(clientID, reference->id);
       //head_->findClient(clientID)->setGamestateID(id);
       return encode(server);
@@ -203,11 +205,11 @@
 
   GameStateCompressed *GameStateManager::encode(GameState *a, GameState *b) {
-    COUT(5) << "G.St.Man: this will be a DIFFED gamestate" << std::endl;
+    COUT(4) << "G.St.Man: this will be a DIFFED gamestate" << std::endl;
     GameState *r = diff(a,b);
-    //r.diffed = true;
+//     r->diffed = true;
 //     GameState *r = b;
 //     r->diffed = false;
-    //return compress_(r);
-    GameStateCompressed *g = new GameStateCompressed;
+    return compress_(r);
+    /*GameStateCompressed *g = new GameStateCompressed;
     g->base_id = r->base_id;
     g->id = r->id;
@@ -216,11 +218,11 @@
     g->normsize = r->size;
     g->compsize = r->size;
-    return g;
+    return g*/;
   }
 
   GameStateCompressed *GameStateManager::encode(GameState *a) {
-    COUT(5) << "G.St.Man: this will be a not diffed gamestate" << std::endl;
-    a->diffed=false;
-    GameStateCompressed *g = new GameStateCompressed;
+    COUT(5) << "G.St.Man: encoding gamestate (compress)" << std::endl;
+    return compress_(a);
+    /*GameStateCompressed *g = new GameStateCompressed;
     g->base_id = a->base_id;
     g->id = a->id;
@@ -229,5 +231,5 @@
     g->normsize = a->size;
     g->compsize = a->size;
-    return g;
+    return g;*/
   }
 
Index: code/branches/network3/src/network/GameStateManager.h
===================================================================
--- code/branches/network3/src/network/GameStateManager.h	(revision 1199)
+++ code/branches/network3/src/network/GameStateManager.h	(revision 1200)
@@ -50,5 +50,5 @@
 {
 
-#define KEEP_GAMESTATES 100
+#define KEEP_GAMESTATES 10
 
   /**
