Changeset 1944 for code/branches/objecthierarchy/src/network
- Timestamp:
- Oct 19, 2008, 12:09:01 AM (16 years ago)
- Location:
- code/branches/objecthierarchy/src/network
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/network/GamestateClient.cc
r1940 r1944 102 102 packet::Gamestate *GamestateClient::getGamestate(){ 103 103 packet::Gamestate *gs = new packet::Gamestate(); 104 gs->collectData(0); 104 if(!gs->collectData(0)){ 105 delete gs; 106 return 0; 107 } 105 108 return gs; 106 109 } -
code/branches/objecthierarchy/src/network/GamestateManager.cc
r1907 r1944 91 91 bool GamestateManager::getSnapshot(){ 92 92 reference = new packet::Gamestate(); 93 reference->collectData(++id_);94 //COUT(4) << "inserting gamestate: " << reference << std::endl;95 //gamestateMap_.insert(std::pair<int, packet::Gamestate*>(id_, reference));96 // gamestateUsed[id_]=0; 93 if(!reference->collectData(++id_)){ //we have no data to send 94 delete reference; 95 reference=0; 96 } 97 97 return true; 98 98 } … … 131 131 packet::Gamestate *gs; 132 132 int gID = ClientInformation::findClient(clientID)->getGamestateID(); 133 if(!reference) 134 return 0; 133 135 gs = reference->doSelection(clientID); 134 136 // gs = new packet::Gamestate(*reference); -
code/branches/objecthierarchy/src/network/Server.cc
r1942 r1944 239 239 if(gs==NULL){ 240 240 COUT(2) << "Server: could not generate gamestate (NULL from compress)" << std::endl; 241 temp = temp->next(); 241 242 continue; 242 243 } … … 324 325 g->setClientID(temp->getID()); 325 326 b = g->collectData(0); 326 assert(b); 327 if(!b) 328 return false; //no data for the client 327 329 b = g->compressData(); 328 330 assert(b);
Note: See TracChangeset
for help on using the changeset viewer.