Changeset 3137 for code/branches/netp4/src/network/TrafficControl.cc
- Timestamp:
- Jun 10, 2009, 12:24:27 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/netp4/src/network/TrafficControl.cc
r3132 r3137 137 137 void TrafficControl::ack(unsigned int clientID, unsigned int gamestateID) 138 138 { 139 if ( !this->bActive_ ) 140 return; 139 141 std::list<obj>::iterator itvec; // iterator to iterate through the acked objects 140 142 … … 227 229 { 228 230 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; 234 238 235 std::map<unsigned int, objInfo >& objectListPerm = clientListPerm_[clientID];239 std::map<unsigned int, objInfo >& objectListPerm = clientListPerm_[clientID]; 236 240 237 238 239 240 {241 for( itvec=list.begin(); itvec != list.end(); itvec++) 242 { 243 if ( objectListPerm.find( (*itvec).objID) != objectListPerm.end() ) 244 { 241 245 // we already have the object in our map 242 246 //obj bleibt in liste und permanente prio wird berechnet 243 objectListPerm[(*itvec).objID].objDiffGS = currentGamestateID - objectListPerm[(*itvec).objID].objCurGS;244 continue;//check next objId245 }246 else247 {247 objectListPerm[(*itvec).objID].objDiffGS = currentGamestateID - objectListPerm[(*itvec).objID].objCurGS; 248 continue;//check next objId 249 } 250 else 251 { 248 252 // 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 257 259 //sort copied list according to priorities 258 260 // use boost bind here because we need to pass a memberfunction to stl sort … … 275 277 // sort(list.begin(), list.end(), boost::bind(&TrafficControl::dataSort, this, _1, _2) ); 276 278 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 277 283 } 278 //diese Funktion updateClientList muss noch gemacht werden279 updateClientListTemp(list);280 //end of sorting281 284 } 282 285
Note: See TracChangeset
for help on using the changeset viewer.