Changeset 6417 for code/trunk/src/libraries/network/GamestateManager.cc
- Timestamp:
- Dec 25, 2009, 10:23:58 PM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/libraries/network/GamestateManager.cc
r5929 r6417 69 69 delete this->reference;std::map<unsigned int, packet::Gamestate*>::iterator it; 70 70 for( it = gamestateQueue.begin(); it != gamestateQueue.end(); ++it ) 71 delete (*it).second;71 delete it->second; 72 72 std::map<unsigned int, std::map<unsigned int, packet::Gamestate*> >::iterator it1; 73 73 std::map<unsigned int, packet::Gamestate*>::iterator it2; … … 75 75 { 76 76 for( it2 = it1->second.begin(); it2 != it1->second.end(); ++it2 ) 77 delete (*it2).second;77 delete it2->second; 78 78 } 79 79 this->trafficControl_->destroy(); … … 126 126 return true; 127 127 } 128 128 129 129 void GamestateManager::sendGamestates() 130 130 { … … 142 142 COUT(5) << "Server: doing gamestate gamestate preparation" << std::endl; 143 143 int cid = temp->getID(); //get client id 144 144 145 145 unsigned int gID = temp->getGamestateID(); 146 146 if(!reference) 147 147 return; 148 148 149 149 packet::Gamestate *client=0; 150 150 if(gID != GAMESTATEID_INITIAL){ … … 156 156 } 157 157 } 158 158 159 159 clientGamestates.push(0); 160 160 finishGamestate( cid, &clientGamestates.back(), client, reference ); 161 //FunctorMember<GamestateManager>* functor = 161 //FunctorMember<GamestateManager>* functor = 162 162 // ExecutorMember<GamestateManager>* executor = createExecutor( createFunctor(&GamestateManager::finishGamestate, this) ); 163 163 // executor->setDefaultValues( cid, &clientGamestates.back(), client, reference ); … … 165 165 // this->threadPool_->passFunction( executor, true ); 166 166 // (*functor)( cid, &(clientGamestates.back()), client, reference ); 167 167 168 168 temp = temp->next(); 169 169 } 170 170 171 171 // threadPool_->synchronise(); 172 172 173 173 while( !clientGamestates.empty() ) 174 174 { … … 185 185 // save the (undiffed) gamestate in the clients gamestate map 186 186 //chose wheather the next gamestate is the first or not 187 187 188 188 packet::Gamestate *gs = gamestate->doSelection(clientID, 20000); 189 189 // packet::Gamestate *gs = new packet::Gamestate(*gamestate); … … 193 193 gamestateMap_[clientID][gamestate->getID()]=gs; 194 194 // this->threadMutex_->unlock(); 195 195 196 196 if(base) 197 197 { 198 198 199 199 // COUT(3) << "diffing" << std::endl; 200 200 // packet::Gamestate* gs1 = gs; … … 210 210 gs = new packet::Gamestate(*gs); 211 211 } 212 213 212 213 214 214 bool b = gs->compressData(); 215 215 assert(b);
Note: See TracChangeset
for help on using the changeset viewer.