Changeset 3043 for code/branches/netp3/src/network/TrafficControl.cc
- Timestamp:
- May 24, 2009, 10:38:06 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/netp3/src/network/TrafficControl.cc
r3015 r3043 142 142 assert(clientListTemp_.find(clientID) != clientListTemp_.end() ); 143 143 assert(clientListPerm_.find(clientID) != clientListPerm_.end() ); 144 assert( clientListTemp_[clientID].find(gamestateID) != clientListTemp_[clientID].end() ); 145 146 for(itvec = clientListTemp_[clientID][gamestateID].begin(); itvec != clientListTemp_[clientID][gamestateID].end(); itvec++) 144 assert( clientListTemp_[clientID].find(gamestateID) != clientListTemp_[clientID].end() ); 145 146 // shortcut for maps 147 std::map<unsigned int, objInfo >& objectListPerm = clientListPerm_[clientID]; 148 std::map<unsigned int, std::vector<obj> >& objectListTemp = clientListTemp_[clientID]; 149 150 for(itvec = objectListTemp[gamestateID].begin(); itvec != objectListTemp[gamestateID].end(); itvec++) 147 151 { 148 if( clientListPerm_[clientID].find((*itvec).objID) != clientListPerm_[clientID].end()) // check whether the obj already exists in our lists149 { 150 clientListPerm_[clientID][(*itvec).objID].objCurGS = gamestateID;151 clientListPerm_[clientID][(*itvec).objID].objValueSched = 0; //set scheduling value back152 if(objectListPerm.find((*itvec).objID) != objectListPerm.end()) // check whether the obj already exists in our lists 153 { 154 objectListPerm[(*itvec).objID].objCurGS = gamestateID; 155 objectListPerm[(*itvec).objID].objValueSched = 0; //set scheduling value back 152 156 } 153 157 else 154 158 { 155 159 assert(0); 156 clientListPerm_[clientID][(*itvec).objID].objCurGS = gamestateID;157 clientListPerm_[clientID][(*itvec).objID].objID = (*itvec).objID;158 clientListPerm_[clientID][(*itvec).objID].objCreatorID = (*itvec).objCreatorID;159 clientListPerm_[clientID][(*itvec).objID].objSize = (*itvec).objSize;160 objectListPerm[(*itvec).objID].objCurGS = gamestateID; 161 objectListPerm[(*itvec).objID].objID = (*itvec).objID; 162 objectListPerm[(*itvec).objID].objCreatorID = (*itvec).objCreatorID; 163 objectListPerm[(*itvec).objID].objSize = (*itvec).objSize; 160 164 } 161 165 } 162 166 // remove temporary list (with acked objects) from the map 163 clientListTemp_[clientID].erase( clientListTemp_[clientID].find(gamestateID) );167 objectListTemp.erase( objectListTemp.find(gamestateID) ); 164 168 } 165 169 … … 227 231 //if listToProcess contains new Objects, add them to clientListPerm 228 232 std::vector<obj>::iterator itvec; 233 234 std::map<unsigned int, objInfo >& objectListPerm = clientListPerm_[clientID]; 235 229 236 for( itvec=list.begin(); itvec != list.end(); itvec++) 230 237 { 231 if ( clientListPerm_[clientID].find( (*itvec).objID) != clientListPerm_[clientID].end() )238 if ( objectListPerm.find( (*itvec).objID) != objectListPerm.end() ) 232 239 { 233 240 // we already have the object in our map 234 241 //obj bleibt in liste und permanente prio wird berechnet 235 clientListPerm_[clientID][(*itvec).objID].objDiffGS = currentGamestateID - clientListPerm_[clientID][(*itvec).objID].objCurGS;242 objectListPerm[(*itvec).objID].objDiffGS = currentGamestateID - objectListPerm[(*itvec).objID].objCurGS; 236 243 continue;//check next objId 237 244 }
Note: See TracChangeset
for help on using the changeset viewer.