Index: code/branches/presentation/src/network/TrafficControl.cc
===================================================================
--- code/branches/presentation/src/network/TrafficControl.cc	(revision 2417)
+++ code/branches/presentation/src/network/TrafficControl.cc	(revision 2418)
@@ -93,16 +93,4 @@
     SetConfigValue ( targetSize, 5000 );
   }
-
-  /**
-          *eigener sortieralgorithmus
-  */
-//   bool TrafficControl::priodiffer(obj i, obj j)
-//   {
-//     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;
-//   }
   
   /**
@@ -138,7 +126,4 @@
 	  currentGamestateID=gamestateID;
 	  evaluateList(clientID, list);
-	  //list hatte vorher ja vielmehr elemente, nach zuweisung nicht mehr... speicherplatz??
-// 	  *list=copiedVector;
-    //später wird copiedVector ja überschrieben, ist das ein problem für list-dh. für gamestatemanager?
 	  return;
 	}
@@ -182,42 +167,5 @@
 *Definition of private members
 */
-	
-	
-	/**
-	*copyList gets list of Gamestate Manager and turns it to *listToProcess
-	*/
-// 	void TrafficControl::copyList(std::list<obj> *list)
-// 	{
-// 	  std::list<obj>::iterator itvec;
-// 	  for(itvec = (*list).begin(); itvec != (*list).end(); itvec++)
-// 	  {
-// 	    objInfo objectA;
-// 	    objectA.objCreatorID=(*itvec).objCreatorID;
-// 	    objectA.objSize = (*itvec).objSize;
-// 	    listToProcess_.insert(std::pair<currentClientID, map<(*itvec).objID,objectA>>);//unsicher: ob map<...> so richtig ist
-// 	  }
-// 	}
-	/**
-	*updateReferenceList compares the sent list by GSmanager with the current *reference list and updates it.
-	*returns void
-	*/
-// 	void TrafficControl::updateReferenceList(std::map<unsigned int, objInfo> *list)
-// 	{
-// 	  std::map<unsigned int, Synchronisable*>::iterator itref;
-// 	  std::map<unsigned int, objInfo>::iterator itproc;
-// 	  for(itproc=listToProcess_.begin(); itproc != listToProcess_.end(); itproc++)
-// 	  {
-// 	    //itproc->first=objectid that is looked for
-// 	    if(referenceList_->find(itproc->first))
-// 	    {
-// 	      continue;
-// 	    }
-// 	    else
-// 	    {
-// 	      (*referenceList_).insert(pair<unsigned int,          Synchronisable*>((*itproc).first,Synchronisable::getSynchronisable((*itproc).first)));//important: how to get adress of an object!
-// 	      insertinClientListPerm(currentClientID,itproc->first,itproc->second);
-// 	    }
-// 	  }
-// 	}
+
 	/**
 	*updateClientListPerm
@@ -242,13 +190,4 @@
   {
     clientListTemp_[currentClientID][currentGamestateID] = std::list<obj>(*list);
-//     std::list<obj>::iterator itvec;
-//     std::map<unsigned int,std::map<unsigned int, obj> >::iterator ittemp;
-//     std::map<unsigned int, obj>::iterator ittempgs;
-//     ittemp = clientListTemp_.find(currentClientID);
-//     ittempgs = (*ittemp).find(currentGamestateID);
-//     for(itvec = list.begin(); itvec!=list.end(), itvec++)
-//     {
-//       ittempgs.insert(itvec);static
-//     }
   }
 
@@ -286,5 +225,4 @@
 	void TrafficControl::evaluateList(unsigned int clientID, std::list<obj> *list)
 	{
-	  //copyList(list);
 	
 	  //now the sorting
@@ -292,11 +230,7 @@
 	  //compare listToProcess vs clientListPerm
     //if listToProcess contains new Objects, add them to clientListPerm
-// 	  std::map<unsigned int, objInfo>::iterator itproc;
     std::list<obj>::iterator itvec;
-// 	  std::map<unsigned int, std::map<unsigned int, objInfo> >::iterator itperm;
-// 	  std::map<unsigned int, objInfo>::iterator itpermobj;
 	  for( itvec=list->begin(); itvec != list->end(); itvec++)
 	  {
-// 	    itperm = clientListPerm_.find(clientID);
 	    if ( clientListPerm_[clientID].find( (*itvec).objID) != clientListPerm_[clientID].end() )
       {
@@ -304,8 +238,4 @@
         //obj bleibt in liste und permanente prio wird berechnet
         clientListPerm_[clientID][(*itvec).objID].objDiffGS = currentGamestateID - clientListPerm_[clientID][(*itvec).objID].objCurGS;
-//         ((*itpermobj).second).objDiffGS = ((*itpermobj).second).objCurGS - currentGamestateID;
-//         permprio = clientListPerm_[clientID][(*itproc).first].objValuePerm;
-//         itpermprio = (permObjPrio_).find((*itproc).first);
-//         ((*itpermobj).second).objValuePerm = ((*itpermobj).second).objDiffGS * (*itpermprio).second;
         continue;//check next objId
       }
@@ -314,67 +244,28 @@
         // insert the object into clientListPerm
         insertinClientListPerm(clientID,*itvec);
-//         itpermobj=(*itperm).find((*itproc).first)
-//         ((*itpermobj).second).objDiffGS = ((*itpermobj).second).objCurGS - currentGamestateID;
-//         itpermprio = (permObjPrio_).find((*itproc).first);
-//         ((*itpermobj).second).objValuePerm = ((*itpermobj).second).objDiffGS * (*itpermprio).second;
         continue;//check next objId
       }
     }
 	  //end compare listToProcess vs clientListPerm
-	
-    //listToProc vs clientListTemp
-    //TODO: uncomment it again and change some things
-    /*
-    std::map<unsigned int, std::map<unsigned int, unsigned int> >::iterator ittemp;
-    std::map<unsigned int, unsigned int>::iterator ittempgs;
-    for( itproc=listToProcess_.begin(); itproc != listToProcess_.end();itproc++)
+    
+    if( bActive_ )
     {
-      ittemp = clientListTemp_->find(currentClientID);
-      if( ittempgs = (*ittemp).find(currentGamestateID))
-      {
-        if((*itproc).first == (*ittempgs).find((*itproc).first))//ja, dann ist objekt schon in der zu sendenden liste-muss nicht nochmal gesendet werden
-        {
-          (listToProcess_).erase (itproc);
-        }
-        else
-          continue;
-      }
-      else
-        continue;
-    }*/
-    //end listToProc vs clientListTemp
-    
-    //TODO: check whether we need this, cause i don't think so.
-    //listToProcess contains obj to send now, and since we give gsmanager the copiedlist and not listToProcess shorten copiedlist therefor too.
-    /*std::list<obj>::iterator itvec;
-    for(itvec = copiedVector.begin(); itvec != copiedVector.end(); itvec++)
-    {
-      if ( listToProcess_.find(itvec->objID) )
-      {
-        continue;//therefore object wasnt thrown out yet and has to be sent back to gsmanager
-      }
-      else
-      {
-        copiedVector.remove(itvec);
-      }
-    }*/
-    //sort copied list aufgrund der objprioperm in clientlistperm
-    // use boost bind here because we need to pass a memberfunction to stl sort
-    list->sort(boost::bind(&TrafficControl::prioritySort, this, clientID, _1, _2) );
-    
-    //now we check, that the creator of an object always exists on a client
-//     printList(list, clientID);
-    std::list<obj>::iterator itcreator;
-    for(itvec = list->begin(); itvec != list->end(); itvec++)
-    { 
-      fixCreatorDependencies(itvec, list, clientID);
+      //sort copied list according to priorities
+      // use boost bind here because we need to pass a memberfunction to stl sort
+      list->sort(boost::bind(&TrafficControl::prioritySort, this, clientID, _1, _2) );
+      
+      //now we check, that the creator of an object always exists on a client
+      std::list<obj>::iterator itcreator;
+      for(itvec = list->begin(); itvec != list->end(); itvec++)
+      { 
+        fixCreatorDependencies(itvec, list, clientID);
+      }
+      //end of sorting
+      //now the cutting, work the same obj out in processobjectlist and copiedlist, compression rate muss noch festgelegt werden. 
+      cut(list, targetSize);
+      
+      //now sort again after objDataOffset
+      list->sort(boost::bind(&TrafficControl::dataSort, this, _1, _2) );
     }
-    //end of sorting
-    //now the cutting, work the same obj out in processobjectlist and copiedlist, compression rate muss noch festgelegt werden. 
-    cut(list, targetSize);
-    
-    //now sort again after objDataOffset
-    list->sort(boost::bind(&TrafficControl::dataSort, this, _1, _2) );
-//     printList(list, clientID);
     //diese Funktion updateClientList muss noch gemacht werden
     updateClientListTemp(list);
@@ -418,13 +309,4 @@
   }
 
-/*
-void bvlabla(list *a){
-//sort a
-list *cache;
-cache = new list<unsigned int>(*a);
-return a;
-}
-*/
-
 
 }//namespace network
