Index: /code/branches/network/src/network/GamestateManager.cc
===================================================================
--- /code/branches/network/src/network/GamestateManager.cc	(revision 2340)
+++ /code/branches/network/src/network/GamestateManager.cc	(revision 2341)
@@ -135,6 +135,4 @@
       return 0;
     gs = reference->doSelection(clientID);
-//     gs = new packet::Gamestate(*reference);
-//     gs = new packet::Gamestate(*reference);
     // save the (undiffed) gamestate in the clients gamestate map
     gamestateMap_[clientID].insert(std::pair<int, packet::Gamestate*>(gs->getID(), gs));
Index: /code/branches/network/src/network/TrafficControl.cc
===================================================================
--- /code/branches/network/src/network/TrafficControl.cc	(revision 2340)
+++ /code/branches/network/src/network/TrafficControl.cc	(revision 2341)
@@ -46,11 +46,5 @@
 	  assert(instance_=0);
 	  instance_=this;
-	  listToProcess_ = new std::map<unsigned int, objInfo>;
-	  clientListPerm_ = new std::map<unsigned int,std::map<unsigned int, objInfo>>;
-	  clientListTemp_ = new std::map std::map<unsigned int, std::map<unsigned int, std::vector<obj>>>;
-	  permObjPrio_ = new std::map<unsigned int, unsigned int> ;
-	  schedObjPrio_ = new std::map<unsigned int, unsigned int> schedObjPrio_;
-          copiedVector = new std::vector<obj>;
-          targetSize = 5000;//5000bytes
+    targetSize = 5000;//5000bytes
 	}
 	
@@ -74,8 +68,8 @@
         bool TrafficControl::priodiffer(obj i, obj j)
         {
-          map<unsigned int, objInfo>::iterator iti;
-          map<unsigned int, objInfo>::iterator itj;
-          iti=listToProcess_->find(i.objID);
-          itj=listToProcess_->find(j.objID);
+          std::map<unsigned int, objInfo>::iterator iti;
+          std::map<unsigned int, objInfo>::iterator itj;
+          iti=listToProcess_.find(i.objID);
+          itj=listToProcess_.find(j.objID);
           return iti->second.objValuePerm < itj->second.objValuePerm;
         }
@@ -90,5 +84,5 @@
 	  evaluateList(list);
 	  //list hatte vorher ja vielmehr elemente, nach zuweisung nicht mehr... speicherplatz??
-	  list=copiedVector;
+	  *list=copiedVector;
           //später wird copiedVector ja überschrieben, ist das ein problem für list-dh. für gamestatemanager?
 	  return list;
@@ -97,36 +91,41 @@
 	void TrafficControl::processAck(unsigned int clientID, unsigned int gamestateID)
 	{
-	  map<unsigned int,std::map<unsigned int, objInfo>>::iterator itperm;//iterator clientListPerm
-	  map<unsigned int, objInfo>::iterator itpermoid;//iterator over objectid
-	  map<unsigned int, std::map<unsigned int, obj>>::iterator ittemp;//iterator clientListTemp, iterates over clientIDs
-	  map<unsigned int, unsigned int>::iterator ittempgs;//iterator that iterates over gsIDs of a client
-	  vector<obj>::iterator itvec;
+	  std::map<unsigned int, std::map<unsigned int, std::vector<objInfo> > >::iterator itperm;//iterator clientListPerm
+	  std::map<unsigned int, std::vector<objInfo> >::iterator itpermObjectIDList;//iterator over objectid
+    std::vector<objInfo>::iterator itpermObjectID;
+    std::map<unsigned int, std::map<unsigned int, std::vector<obj> > >::iterator ittemp;//iterator clientListTemp, iterates over clientIDs
+	  std::map<unsigned int, std::vector<obj> >::iterator ittempgs;//iterator that iterates over gsIDs of a client
+	  std::vector<obj>::iterator itvec;
 	  //following code helps to put clientListTemp infos into clientListPerm infos
-	  ittemp = (clientListTemp_).find(clientID);
-	  assert(ittemp != clientListTemp_.end() ); //muss da nicht was anderes überprüft werden?
-	  itperm = (clientListPerm_).find(clientID);
+	  ittemp = clientListTemp_.find(clientID);
+	  assert(ittemp != clientListTemp_.end() ); //muss da nicht was anderes überprüft werden? -> nein
+	  itperm = clientListPerm_.find(clientID);
 	  assert(itperm != clientListPerm_.end() );
-	  ittempgs = (*ittemp).find(gamestateID);
-	  assert( ittempgs != (*ittemp).end() );//gleiche frage wie vorher
-	  for(itvec = *ittempgs.begin(); itvec = *ittempgs.end(); itvec++)
-	  { 
-	    if(itpermoid = (*itperm).find(itvec.objID))
-	    {
-	      if(gamestateID>(*itpermoid).second.objCurGS)
-	      {
-		(*itpermoid).second.objCurGS = gamestateID;
-	      }
-	      else continue;
-	    }
-	    else
-	    {
-	      objInfo objinf = new objInfo;
-	      objinf.objCurGS = gamestateID;
-	      insertinClientListPerm(clientID, itvec.objID, objinf);
-	    }
-	    //entferne objekt aus temporärer liste
-	    ittempgs.erase(itvec);
-	  }
-	
+	  ittempgs = ittemp->second.find(gamestateID);
+	  assert( ittempgs != ittemp->second.end() );//gleiche frage wie vorher -> nein
+	  for(itvec = ittempgs->second.begin(); itvec != ittempgs->second.end(); itvec++)
+	  {
+      bool alreadyExisting = false;
+      itpermObjectIDList = itperm->second.find(gamestateID);
+      assert(itpermObjectIDList != itperm->second.end());
+      for (itpermObjectID = itpermObjectIDList->second.begin(); itpermObjectID != itpermObjectIDList->second.end(); itpermObjectID++ )
+      {
+        if ( (*itpermObjectID).objID == (*itvec).objID)
+        {
+          (*itpermObjectID).objCurGS = gamestateID;
+          alreadyExisting = true;
+          break;
+        }
+        if ( !alreadyExisting )
+        {
+          objInfo objinf;    // TODO: is this initialisation complete ?
+          objinf.objCurGS = gamestateID;
+          objinf.objID = (*itvec).objID;
+          insertinClientListPerm(clientID, (*itvec).objID, objinf);
+        }
+      }
+	  }
+	   // remove temporary vector (with acked objects) from the map
+    ittemp->second.erase(ittempgs);
 	}
 
@@ -139,13 +138,13 @@
 	*copyList gets vector of Gamestate Manager and turns it to *listToProcess
 	*/
-	void TrafficControl::copyList(std::map<obj> *list)
-	{
-	  vector<obj>::iterator itvec;
-	  for(itvec = (*list).begin(); itvec < (*list).end(); itvec++)
-	  {
-	    objInfo objectA = new objInfo;
-	    (*objectA).objCreatorID=(*itvec).objCreatorID;
-	    (*objectA).objSize = (*itvec).objSize;
-	    (*listToProcess_).insert(pair<currentClientID, map<(*itvec).objID,objectA>>);//unsicher: ob map<...> so richtig ist
+	void TrafficControl::copyList(std::vector<obj> *list)
+	{
+	  std::vector<obj>::iterator itvec;
+	  for(itvec = (*list).begin(); itvec != (*list).end(); itvec++)
+	  {
+	    objInfo objectA;
+	    objectA.objCreatorID=(*itvec).objCreatorID;
+	    objectA.objSize = (*itvec).objSize;
+	    listToProcess_.insert(pair<currentClientID, map<(*itvec).objID,objectA>>);//unsicher: ob map<...> so richtig ist
 	  }
 	}
@@ -228,5 +227,4 @@
 	{
 	  copyList(list);
-	  updateReferenceList(listToProcess_);
 	
 	  //now the sorting
@@ -235,5 +233,5 @@
           //if listToProcess contains new Objects, add them to clientListPerm
 	  std::map<unsigned int, objInfo>::iterator itproc;
-	  std::map<unsigned int, std::map<unsigned int, objInfo>>::iterator itperm;
+	  std::map<unsigned int, std::map<unsigned int, objInfo> >::iterator itperm;
 	  std::map<unsigned int, objInfo>::iterator itpermobj;
 	  std::map<unsigned int, unsigned int>::iterator itpermprio;
@@ -269,5 +267,5 @@
 	
 	//listToProc vs clientListTemp
-	map<unsigned int, std::map<unsigned int, unsigned int>>::iterator ittemp;
+	map<unsigned int, std::map<unsigned int, unsigned int> >::iterator ittemp;
 	map<unsigned int, unsigned int>::iterator ittempgs;
 	for((itproc=listToProcess_).begin(); itproc != (listToProcess_).end();itproc++)
Index: /code/branches/network/src/network/TrafficControl.h
===================================================================
--- /code/branches/network/src/network/TrafficControl.h	(revision 2340)
+++ /code/branches/network/src/network/TrafficControl.h	(revision 2341)
@@ -37,4 +37,5 @@
 #include "NetworkPrereqs.h"
 #include "Synchronisable.h"
+#include "util/Integers.h"
 
 namespace network {
@@ -45,8 +46,9 @@
 struct objInfo
 {
-  unsigned int objCreatorID;
-  unsigned int objCurGS;//current GameState ID
-  unsigned int objDiffGS;//difference between current and latest GameState
-  unsigned int objSize;
+  uint32_t objID;
+  uint32_t objCreatorID;
+  int32_t objCurGS;//current GameState ID
+  int32_t objDiffGS;//difference between current and latest GameState
+  uint32_t objSize;
   unsigned int objValuePerm;
   unsigned int objValueSched;
@@ -88,5 +90,5 @@
     *permanent client list: contains client ids, object ids and objectInfos (in this order)
     */
-    std::map<unsigned int, std::map<unsigned int, objInfo>> clientListPerm_;
+    std::map<unsigned int, std::map<unsigned int, std::vector<objInfo> > > clientListPerm_;
     //has to be created with constructor and then needs to be updated by evaluateList().
 
@@ -94,5 +96,5 @@
     *temporary client list: contains client ids, gamestate ids and object ids (in this order)
     */
-    std::map<unsigned int, std::map<unsigned int, std::vector<obj>>> clientListTemp_;
+    std::map<unsigned int, std::map<unsigned int, std::vector<obj> > > clientListTemp_;
     /**
     *static priority list: contains obj id, basic priority (in this order)
@@ -105,5 +107,5 @@
     //end: lists to be used
 
-    /**
+    /**updateReferenceList
     *currentGamestateID and currentClientID will be defined as soon as TrafficControl is being called by Server
     */
