Changeset 2758 for code/branches/network/src/network/packet/Gamestate.cc
- Timestamp:
- Mar 8, 2009, 4:40:01 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/src/network/packet/Gamestate.cc
r2710 r2758 48 48 #define PACKET_FLAG_GAMESTATE ENET_PACKET_FLAG_RELIABLE 49 49 50 // Gamestate::Gamestate()51 // {52 // flags_ = flags_ | PACKET_FLAG_GAMESTATE;53 // }54 50 55 51 Gamestate::Gamestate() … … 127 123 #endif 128 124 129 //if(it->doSelection(id))130 125 if ( it->doSync( id, mode ) ) 131 126 dataMap_.push_back( obj(it->getObjectID(), it->getCreatorID(), tempsize, mem-data_) ); 132 // dataMap_[mem-data_]=(*it); // save the mem location of the synchronisable data133 127 if(!it->getData(mem, id, mode)) 134 128 return false; // mem pointer gets automatically increased because of call by reference … … 158 152 assert(!header_->isDiffed()); 159 153 uint8_t *mem=data_+GamestateHeader::getSize(); 160 // get the start of the Synchronisable list161 //ObjectList<Synchronisable>::iterator it=ObjectList<Synchronisable>::begin();162 154 Synchronisable *s; 163 155 … … 177 169 mem += objectheader.getDataSize(); 178 170 } 179 // COUT(0) << "could not fabricate synchronisable: " << objectheader->objectID << " classid: " << objectheader->classID << " creator: " << objectheader->creatorID << endl;180 // else181 // COUT(0) << "fabricated: " << objectheader->objectID << " classid: " << objectheader->classID << " creator: " << objectheader->creatorID << endl;182 171 } 183 172 else 184 173 { 185 174 bool b = s->updateData(mem, mode); 186 // if(!b)187 // COUT(0) << "data could not be updated" << endl;188 175 assert(b); 189 176 } … … 262 249 uint8_t *ndata = new uint8_t[buffer+GamestateHeader::getSize()]; 263 250 uint8_t *dest = ndata + GamestateHeader::getSize(); 264 //unsigned char *dest = new unsigned char[buffer];265 251 uint8_t *source = data_ + GamestateHeader::getSize(); 266 252 int retval; … … 294 280 uint32_t compsize = header_->getCompSize(); 295 281 uint32_t bufsize; 296 // assert(compsize<=datasize);297 282 bufsize = datasize; 298 283 assert(bufsize!=0); … … 340 325 assert(!header_->isDiffed()); 341 326 GamestateHeader diffHeader(base->data_); 342 //unsigned char *basep = base->getGs()/*, *gs = getGs()*/;343 327 uint8_t *basep = GAMESTATE_START(base->data_), *gs = GAMESTATE_START(this->data_); 344 328 uint32_t of=0; // pointers offset … … 397 381 //copy in the zeros 398 382 for(it=dataMap_.begin(); it!=dataMap_.end();){ 399 // if((*it).objSize==0)400 // continue;401 // if(it->second->getSize(HEADER->id)==0) // merged from objecthierarchy2, doesn't work anymore; TODO: change this402 // continue; // merged from objecthierarchy2, doesn't work anymore; TODO: change this403 383 SynchronisableHeader oldobjectheader(origdata); 404 384 SynchronisableHeader newobjectheader(newdata); … … 408 388 continue; 409 389 } 410 // object = Synchronisable::getSynchronisable( (*it).objID );411 // assert(object->objectID == oldobjectheader->objectID);412 390 objectsize = oldobjectheader.getDataSize(); 413 391 objectOffset=SynchronisableHeader::getSize(); //skip the size and the availableData variables in the objectheader … … 447 425 assert(header_->isDiffed()); 448 426 assert(!header_->isCompressed() && !base->header_->isCompressed()); 449 //unsigned char *basep = base->getGs()/*, *gs = getGs()*/;450 427 uint8_t *basep = GAMESTATE_START(base->data_); 451 428 uint8_t *gs = GAMESTATE_START(this->data_);
Note: See TracChangeset
for help on using the changeset viewer.