Index: code/branches/network/src/network/TrafficControl.cc
===================================================================
--- code/branches/network/src/network/TrafficControl.cc	(revision 2231)
+++ code/branches/network/src/network/TrafficControl.cc	(revision 2276)
@@ -61,5 +61,5 @@
 */
 
-TrafficControl::processObjectList(unsigned int clientID, unsigned int gamestateID, std::vector<unsigned> *list)
+TrafficControl::processObjectList(unsigned int clientID, unsigned int gamestateID, std::vector<obj> *list)
 {
   currentClientID=clientID;
@@ -136,7 +136,66 @@
   copyList(list);
   updateReferenceList(listToProcess_);
-
+  
   //now the sorting
+
+  //compare listToProcess vs clientListPerm
+  map<unsigned int, objInfo>::iterator itproc;
+  map<unsigned int,std::map<unsigned int, objInfo>>::iterator itperm;
+  map<unsigned int, objInfo>::iterator itpermobj;
+  map<unsigned int, unsigned int>::iterator itpermprio
+  for(itproc=listToProcess_->begin(); itproc != listToProcess_->end();it++)
+  {
+    itperm=clientListPerm->find(currentClientID);
+    itpermobj=itperm->find(itproc->first);
+    if(currentGamestateID < (itpermobj->second).objCurGS)
+    {
+      //obj bleibt in liste und permanente prio wird berechnet
+      (itpermobj->second).objDiffGS = (itpermobj->second).objCurGS - currentGamestateID;
+      itpermprio = permObjPrio_->find(itproc->first);
+      (itpermobj->second).objValuePerm = (itpermobj->second).objDiffGS * itpermprio->second;
+      continue;//check next objId
+    }
+    else
+    {
+      listToProcess_->erase (itproc);
+    }
+  }
+  //end compare listToProcess vs clientListPerm
+
+  //listToProc vs clientListTemp
+  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();it++)
+  {
+    ittemp = clientListTemp_->find(currentClientID);
+    if(ittempgs = ittemp->find(currentGamestateID))
+    {
+      if(itproc->first == ittempgs->find(itproc->first))
+      {
+        listToProcess_->erase (itproc);
+      }
+      else continue;
+    }
+    else continue;
+  }
+  //end listToProc vs clientListTemp
   
+  //listToProcess contains obj to send now, shorten copiedvector therefor too.
+  vector<obj>::iterator itvec;
+  for(itvec = copiedvector.begin(); itvec < copiedvector.end(); itvec++)
+  {
+    if(listToProcess_->find(itvec->objID))
+    {
+      continue;
+    }
+    else
+    {
+      copiedvector.remove(itvec);
+    }
+  }
+  //sort copied vector aufgrund der objprioperm in clientlistperm
+  sort(copiedvector.begin(),copiedvector.end(),priodiffer);
+  //swappen aufgrund von creator oder ganz rausnehmen!?
+
   //end of sorting
   return evaluatedList_;
Index: code/branches/network/src/network/TrafficControl.h
===================================================================
--- code/branches/network/src/network/TrafficControl.h	(revision 2231)
+++ code/branches/network/src/network/TrafficControl.h	(revision 2276)
@@ -33,4 +33,5 @@
 #include <map>
 #include <utility>
+#include <algorithm>
 
 #include "NetworkPrereqs.h"
@@ -40,4 +41,12 @@
 
 // Synchronisable *bla = Synchronisable::getSynchronisable(objectID);
+
+//stuff to iterate through:  map<unsigned int, objInfo>::iterator itproc;
+//   map<unsigned int, Synchronisable>::iterator itref;
+//   for(it=listToProcess_->begin(); it != listToProcess_->end();it++)
+//   {
+//   
+//     itref=referenceList_->find((*itproc).first);
+//     refCurObj=(*itref).second;
 
 /**
@@ -50,4 +59,6 @@
   unsigned int objDiffGS;//difference between current and latest GameState
   unsigned int objSize;
+  unsigned int objValuePerm;
+  unsigned int objValueSched;
 };
 
@@ -62,4 +73,15 @@
 };
 
+/**
+*eigener sortieralgorithmus
+*/
+bool 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);
+  return iti->second.objValuePerm < itj->second.objValuePerm;
+}
 
 /**
@@ -77,13 +99,15 @@
     *reference list: contains object ids and the reference belonging to this id.
     */
-    std::map<unsigned int, Synchronisable*> *referenceList_;//has to be created with constructor and then needs to be updated by evaluateList().
+//     std::map<unsigned int, Synchronisable*> *referenceList_;//has to be created with constructor and then needs to be updated by evaluateList().
     /**
     *permanent client list: contains client ids, gamestate ids and object ids (in this order)
     */
-    std::map<unsigned int, objInfo> *clientListPerm_; //has to be created with constructor and then needs to be updated by evaluateList().
+    std::map<unsigned int, std::map<unsigned int, objInfo>> *clientListPerm_;
+    //has to be created with constructor and then needs to be updated by evaluateList().
+
     /**
     *temporary client list: contains client ids, gamestate ids and object ids (in this order)
     */
-    std::map<unsigned int,std::map<unsigned int, unsigned int>> *clientListTemp_;
+    std::map<unsigned int, std::map<unsigned int, std::vector<obj>>> *clientListTemp_;
     /**
     *static priority list: contains obj id, basic priority (in this order)
@@ -101,4 +125,7 @@
     unsigned int currentGamestateID;
     unsigned int currentClientID;
+    Synchronisable *refCurObj;//reference to current object, uninitialized yet, do I have to or can I just set refCurObj=...; later on? 
+    //not used yet anyway
+    std::vector<obj> copiedVector; //copy of original that I get from GSmanager
 
     void updateReferenceList(std::map<unsigned int, objInfo> *list);
