Index: code/branches/pickup2/src/libraries/network/TrafficControl.cc
===================================================================
--- code/branches/pickup2/src/libraries/network/TrafficControl.cc	(revision 5942)
+++ code/branches/pickup2/src/libraries/network/TrafficControl.cc	(revision 6412)
@@ -64,24 +64,24 @@
 *Initializing protected members
 */
-	TrafficControl *TrafficControl::instance_=0;
-
-	/**
-	* @brief Constructor: assures that only one reference will be created and sets the pointer
-	*/
-	TrafficControl::TrafficControl()
-	{
+    TrafficControl *TrafficControl::instance_=0;
+
+    /**
+    * @brief Constructor: assures that only one reference will be created and sets the pointer
+    */
+    TrafficControl::TrafficControl()
+    {
     RegisterObject(TrafficControl);
-	  assert(instance_==0);
-	  instance_=this;
+      assert(instance_==0);
+      instance_=this;
     this->setConfigValues();
-	}
-
-	/**
-	* @brief Destructor: resets the instance pointer to 0
-	*/
-	TrafficControl::~TrafficControl()
-	{
-	  instance_=0;
-	}
+    }
+
+    /**
+    * @brief Destructor: resets the instance pointer to 0
+    */
+    TrafficControl::~TrafficControl()
+    {
+      instance_=0;
+    }
 
 /**
@@ -121,11 +121,11 @@
 
 
-	void TrafficControl::processObjectList(unsigned int clientID, unsigned int gamestateID, std::list<obj>& list)
-	{
-	  currentClientID=clientID;
-	  currentGamestateID=gamestateID;
-	  evaluateList(clientID, list);
-	  return;
-	}
+    void TrafficControl::processObjectList(unsigned int clientID, unsigned int gamestateID, std::list<obj>& list)
+    {
+      currentClientID=clientID;
+      currentGamestateID=gamestateID;
+      evaluateList(clientID, list);
+      return;
+    }
 
   TrafficControl *TrafficControl::getInstance()
@@ -135,9 +135,9 @@
   }
 
-	void TrafficControl::ack(unsigned int clientID, unsigned int gamestateID)
-	{
+    void TrafficControl::ack(unsigned int clientID, unsigned int gamestateID)
+    {
     if ( !this->bActive_ )
       return;
-	  std::list<obj>::iterator itvec;  // iterator to iterate through the acked objects
+      std::list<obj>::iterator itvec;  // iterator to iterate through the acked objects
 
     //assertions to make sure the maps already exist
@@ -145,5 +145,5 @@
     assert(clientListPerm_.find(clientID) != clientListPerm_.end() );
     assert( clientListTemp_[clientID].find(gamestateID) != clientListTemp_[clientID].end() );
-    
+
     // shortcut for maps
     std::map<unsigned int, objInfo >& objectListPerm = clientListPerm_[clientID];
@@ -151,22 +151,22 @@
 
     for(itvec = objectListTemp[gamestateID].begin(); itvec != objectListTemp[gamestateID].end(); itvec++)
-	  {
-      if(objectListPerm.find((*itvec).objID) != objectListPerm.end()) // check whether the obj already exists in our lists
-      {
-        objectListPerm[(*itvec).objID].objCurGS = gamestateID;
-        objectListPerm[(*itvec).objID].objValueSched = 0; //set scheduling value back
+      {
+      if(objectListPerm.find(itvec->objID) != objectListPerm.end()) // check whether the obj already exists in our lists
+      {
+        objectListPerm[itvec->objID].objCurGS = gamestateID;
+        objectListPerm[itvec->objID].objValueSched = 0; //set scheduling value back
       }
       else
       {
         assert(0);
-        objectListPerm[(*itvec).objID].objCurGS = gamestateID;
-        objectListPerm[(*itvec).objID].objID = (*itvec).objID;
-        objectListPerm[(*itvec).objID].objCreatorID = (*itvec).objCreatorID;
-        objectListPerm[(*itvec).objID].objSize = (*itvec).objSize;
-      }
-	  }
-	   // remove temporary list (with acked objects) from the map
+        objectListPerm[itvec->objID].objCurGS = gamestateID;
+        objectListPerm[itvec->objID].objID = itvec->objID;
+        objectListPerm[itvec->objID].objCreatorID = itvec->objCreatorID;
+        objectListPerm[itvec->objID].objSize = itvec->objSize;
+      }
+      }
+       // remove temporary list (with acked objects) from the map
     objectListTemp.erase( objectListTemp.find(gamestateID) );
-	}
+    }
 
 /**
@@ -174,14 +174,14 @@
 */
 
-	/**
-	*updateClientListPerm
-	*returns void
-	*/
-	void TrafficControl::insertinClientListPerm(unsigned int clientID, obj objinf)
-	{
-	  std::map<unsigned int,std::map<unsigned int, objInfo> >::iterator itperm;//iterator clientListPerm over clientIDs
+    /**
+    *updateClientListPerm
+    *returns void
+    */
+    void TrafficControl::insertinClientListPerm(unsigned int clientID, obj objinf)
+    {
+      std::map<unsigned int,std::map<unsigned int, objInfo> >::iterator itperm;//iterator clientListPerm over clientIDs
     unsigned int gsid=GAMESTATEID_INITIAL, gsdiff=currentGamestateID, prioperm=Synchronisable::getSynchronisable(objinf.objID)->getPriority(), priomom=0;
     clientListPerm_[clientID][objinf.objID] = objInfo(objinf.objID, objinf.objCreatorID,gsid,gsdiff, objinf.objSize,prioperm,priomom);
-	}
+    }
 
   /**
@@ -205,13 +205,13 @@
     for(itvec = list.begin(); itvec != list.end();)
     {
-      assert( (*itvec).objSize < 1000);
-      if ( ( size + (*itvec).objSize ) < targetsize )
-      {
-        size += (*itvec).objSize;//objSize is given in bytes
+      assert( itvec->objSize < 1000);
+      if ( ( size + itvec->objSize ) < targetsize )
+      {
+        size += itvec->objSize;//objSize is given in bytes
         ++itvec;
       }
       else
       {
-        clientListPerm_[currentClientID][(*itvec).objID].objValueSched += SCHED_PRIORITY_OFFSET; // NOTE: SCHED_PRIORITY_OFFSET is negative
+        clientListPerm_[currentClientID][itvec->objID].objValueSched += SCHED_PRIORITY_OFFSET; // NOTE: SCHED_PRIORITY_OFFSET is negative
         list.erase(itvec, list.end());
         break;
@@ -223,9 +223,9 @@
 
 
-	/**
-	*evaluateList evaluates whether new obj are there, whether there are things to be updatet and manipulates all this.
-	*/
-	void TrafficControl::evaluateList(unsigned int clientID, std::list<obj>& list)
-	{
+    /**
+    *evaluateList evaluates whether new obj are there, whether there are things to be updatet and manipulates all this.
+    */
+    void TrafficControl::evaluateList(unsigned int clientID, std::list<obj>& list)
+    {
 
     if( bActive_ )
@@ -236,14 +236,14 @@
       //if listToProcess contains new Objects, add them to clientListPerm
       std::list<obj>::iterator itvec;
-    
+
       std::map<unsigned int, objInfo >& objectListPerm = clientListPerm_[clientID];
-    
+
       for( itvec=list.begin(); itvec != list.end(); itvec++)
       {
-        if ( objectListPerm.find( (*itvec).objID) != objectListPerm.end() )
+        if ( objectListPerm.find( itvec->objID) != objectListPerm.end() )
         {
         // we already have the object in our map
         //obj bleibt in liste und permanente prio wird berechnet
-          objectListPerm[(*itvec).objID].objDiffGS = currentGamestateID - objectListPerm[(*itvec).objID].objCurGS;
+          objectListPerm[itvec->objID].objDiffGS = currentGamestateID - objectListPerm[itvec->objID].objCurGS;
           continue;//check next objId
         }
@@ -256,10 +256,10 @@
       }
     //end compare listToProcess vs clientListPerm
-      
+
       //sort copied list according to priorities
       // use boost bind here because we need to pass a memberfunction to stl sort
 //       sort( list.begin(), list.end(), boost::bind(&TrafficControl::prioritySort, this, clientID, _1, _2) );
       list.sort( boost::bind(&TrafficControl::prioritySort, this, clientID, _1, _2) );
-      
+
 //       list.sort(boost::bind(&TrafficControl::prioritySort, this, clientID, _1, _2) );
 
@@ -277,5 +277,5 @@
 //       sort(list.begin(), list.end(), boost::bind(&TrafficControl::dataSort, this, _1, _2) );
       list.sort( boost::bind(&TrafficControl::dataSort, this, _1, _2) );
-      
+
       //diese Funktion updateClientList muss noch gemacht werden
       updateClientListTemp(list);
@@ -289,17 +289,17 @@
     COUT(0) << "=========== Objectlist ===========" << endl;
     for( it=list.begin(); it!=list.end(); it++)
-      COUT(0) << "ObjectID: " << (*it).objID << " creatorID: " << (*it).objCreatorID << " Priority: " << clientListPerm_[clientID][(*it).objID].objValuePerm + clientListPerm_[clientID][(*it).objID].objValueSched << " size: " << (*it).objSize << endl;
+      COUT(0) << "ObjectID: " << it->objID << " creatorID: " << it->objCreatorID << " Priority: " << clientListPerm_[clientID][it->objID].objValuePerm + clientListPerm_[clientID][it->objID].objValueSched << " size: " << it->objSize << endl;
   }
 
   void TrafficControl::fixCreatorDependencies(std::list<obj>::iterator it1, std::list<obj>& list, unsigned int clientID)
   {
-    if ( (*it1).objCreatorID == OBJECTID_UNKNOWN )
-      return;
-    if( clientListPerm_[clientID][(*it1).objCreatorID].objCurGS != GAMESTATEID_INITIAL )
+    if ( it1->objCreatorID == OBJECTID_UNKNOWN )
+      return;
+    if( clientListPerm_[clientID][it1->objCreatorID].objCurGS != GAMESTATEID_INITIAL )
       return;
     std::list<obj>::iterator it2, it3=it1;
     for( it2 = ++it3; it2 != list.end(); it2++ )
     {
-      if( (*it2).objID == (*it1).objCreatorID )
+      if( it2->objID == it1->objCreatorID )
       {
         it3 = list.insert(it1, *it2); //insert creator before it1
