Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 10, 2009, 12:24:27 PM (15 years ago)
Author:
scheusso
Message:

various performance and memory issues fixed

File:
1 edited

Legend:

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

    r3132 r3137  
    137137        void TrafficControl::ack(unsigned int clientID, unsigned int gamestateID)
    138138        {
     139    if ( !this->bActive_ )
     140      return;
    139141          std::list<obj>::iterator itvec;  // iterator to iterate through the acked objects
    140142
     
    227229        {
    228230
    229           //now the sorting
    230 
    231           //compare listToProcess vs clientListPerm
    232     //if listToProcess contains new Objects, add them to clientListPerm
    233     std::list<obj>::iterator itvec;
     231    if( bActive_ )
     232    {
     233      //now the sorting
     234
     235      //compare listToProcess vs clientListPerm
     236      //if listToProcess contains new Objects, add them to clientListPerm
     237      std::list<obj>::iterator itvec;
    234238   
    235     std::map<unsigned int, objInfo >& objectListPerm = clientListPerm_[clientID];
     239      std::map<unsigned int, objInfo >& objectListPerm = clientListPerm_[clientID];
    236240   
    237           for( itvec=list.begin(); itvec != list.end(); itvec++)
    238           {
    239             if ( objectListPerm.find( (*itvec).objID) != objectListPerm.end() )
    240       {
     241      for( itvec=list.begin(); itvec != list.end(); itvec++)
     242      {
     243        if ( objectListPerm.find( (*itvec).objID) != objectListPerm.end() )
     244        {
    241245        // we already have the object in our map
    242246        //obj bleibt in liste und permanente prio wird berechnet
    243         objectListPerm[(*itvec).objID].objDiffGS = currentGamestateID - objectListPerm[(*itvec).objID].objCurGS;
    244         continue;//check next objId
    245       }
    246       else
    247       {
     247          objectListPerm[(*itvec).objID].objDiffGS = currentGamestateID - objectListPerm[(*itvec).objID].objCurGS;
     248          continue;//check next objId
     249        }
     250        else
     251        {
    248252        // insert the object into clientListPerm
    249         insertinClientListPerm(clientID,*itvec);
    250         continue;//check next objId
    251       }
    252     }
    253           //end compare listToProcess vs clientListPerm
    254 
    255     if( bActive_ )
    256     {
     253          insertinClientListPerm(clientID,*itvec);
     254          continue;//check next objId
     255        }
     256      }
     257    //end compare listToProcess vs clientListPerm
     258     
    257259      //sort copied list according to priorities
    258260      // use boost bind here because we need to pass a memberfunction to stl sort
     
    275277//       sort(list.begin(), list.end(), boost::bind(&TrafficControl::dataSort, this, _1, _2) );
    276278      list.sort( boost::bind(&TrafficControl::dataSort, this, _1, _2) );
     279     
     280      //diese Funktion updateClientList muss noch gemacht werden
     281      updateClientListTemp(list);
     282      //end of sorting
    277283    }
    278     //diese Funktion updateClientList muss noch gemacht werden
    279     updateClientListTemp(list);
    280     //end of sorting
    281284  }
    282285
Note: See TracChangeset for help on using the changeset viewer.