- Timestamp:
- Dec 19, 2010, 9:41:57 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network5/src/libraries/network/GamestateManager.cc
r7777 r7780 110 110 bool b = processGamestate(it->second); 111 111 assert(b); 112 sendAck( it->second->getID(), it->second->getPeerID() ); 112 113 delete it->second; 113 114 } … … 117 118 NetworkCallbackManager::callCallbacks(); 118 119 return true; 120 } 121 122 bool GamestateManager::sendAck(unsigned int gamestateID, uint32_t peerID) 123 { 124 packet::Acknowledgement *ack = new packet::Acknowledgement(gamestateID, peerID); 125 if( !this->sendPacket(ack)) 126 { 127 COUT(3) << "could not ack gamestate: " << gamestateID << std::endl; 128 return false; 129 } 130 else 131 { 132 COUT(5) << "acked a gamestate: " << gamestateID << std::endl; 133 return true; 134 } 119 135 } 120 136 … … 173 189 peerGamestates.push_back(0); // insert an empty gamestate* to change 174 190 finishGamestate( peerID, peerGamestates.back(), baseGamestate, currentGamestate_ ); 191 if( peerGamestates.back()==0 ) 192 // nothing to send to remove pointer from vector 193 peerGamestates.pop_back(); 175 194 //FunctorMember<GamestateManager>* functor = 176 195 // ExecutorMember<GamestateManager>* executor = createExecutor( createFunctor(&GamestateManager::finishGamestate, this) ); … … 236 255 237 256 238 bool GamestateManager::ackGamestate(unsigned int gamestateID, unsigned int peerID) { 257 bool GamestateManager::ackGamestate(unsigned int gamestateID, unsigned int peerID) 258 { 239 259 // ClientInformation *temp = ClientInformation::findClient(peerID); 240 260 // assert(temp); … … 255 275 } 256 276 257 assert(curid==GAMESTATEID_INITIAL || curid< gamestateID);277 assert(curid==GAMESTATEID_INITIAL || curid<=gamestateID); 258 278 COUT(5) << "acking gamestate " << gamestateID << " for peerID: " << peerID << " curid: " << curid << std::endl; 259 279 std::map<uint32_t, packet::Gamestate*>::iterator it2;
Note: See TracChangeset
for help on using the changeset viewer.