Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2317


Ignore:
Timestamp:
Dec 3, 2008, 2:45:29 PM (15 years ago)
Author:
chpeter
Message:

temporary update of trafficcontrol

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/network/TrafficControl.cc

    r2276 r2317  
    4545  assert(instance_=0);
    4646  instance_=this;
    47   clientListPerm_=new std::map<unsigned int,std::map<unsigned int, unsigned int>>;
     47  clientListPerm_=new std::map<unsigned int,std::map<unsigned int, objInfo>>;
    4848  referenceList_=new std::map<unsigned int, Synchronisable*>;
    4949}
     
    197197  sort(copiedvector.begin(),copiedvector.end(),priodiffer);
    198198  //swappen aufgrund von creator oder ganz rausnehmen!?
    199 
     199  for(itvec = copiedVector.begin(); itvec < copiedVector.end(); itvec++)
     200  {
     201    itproc = listToProcess_->find(itvec->objID);
     202    if(itproc->second.objCreatorID)
     203    {
     204      //vor dem child in copiedvector einfügen, wie?
     205      copiedVector.insert(itproc->second.objCreatorID);
     206    }
     207    else continue;
     208  }
    200209  //end of sorting
    201   return evaluatedList_;
     210  //now the cutting, work the same obj out in processobjectlist and copiedvector, compression rate muss noch festgelegt werden.
     211  cut(copiedVector,compressionRate-1);
     212  //diese Funktion updateClientList muss noch gemacht werden
     213  updateClientListTemp(copiedVector);
     214  //end of sorting
     215}
     216
     217TrafficControl::processAck(unsigned int clientID, unsigned int gamestateID)
     218{
     219  map<unsigned int,std::map<unsigned int, objInfo>>::iterator itperm;
     220  map<unsigned int, std::map<unsigned int, unsigned int>>::iterator ittemp;
     221  map<unsigned int, unsigned int>::iterator ittempgs;
     222  vector<obj>::iterator itvec;
     223  //put temporarylist infos into permanentlist infos
     224  ittemp = clientListTemp_->find(clientID);
     225  assert(ittemp != clientListTemp_.end() );
     226  ittempgs = (*ittemp).find(gamestateID);
     227  assert( ittempgs != (*ittemp).end() );
     228  for(itvec = *ittempgs.begin(); itvec = *ittempgs.end(); itvec++)
     229  {
     230    if(itperm = (*clientListPerm_).find(itvec.objID))
     231    {
     232      itperm = (*clientListPerm_).find(itvec.objID);
     233      if(gamestateID>itperm.second.objCurGS)
     234      {
     235        itperm.second.objCurGS = gamestateID;
     236      }
     237      else continue;
     238    }
     239    else
     240    {
     241      objInfo objinf = new objInfo;
     242      objinf.objCurGS = gamestateID;
     243      insertinClientListPerm(itvec.objID, objinf);
     244    }
     245    //entferne objekt aus temporärer liste
     246    ittempgs.erase(itvec);
     247  }
     248 
    202249}
    203250
Note: See TracChangeset for help on using the changeset viewer.