Changeset 2417
- Timestamp:
- Dec 12, 2008, 10:56:22 AM (16 years ago)
- Location:
- code/branches/presentation/src/network
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation/src/network/packet/Gamestate.cc
r2382 r2417 151 151 if(!s) 152 152 { 153 s = Synchronisable::fabricate(mem, mode); 154 if(s==0) 155 assert(0); 153 Synchronisable::fabricate(mem, mode); 156 154 // COUT(0) << "could not fabricate synchronisable: " << objectheader->objectID << " classid: " << objectheader->classID << " creator: " << objectheader->creatorID << endl; 157 155 // else … … 349 347 Gamestate *gs = new Gamestate(gdata); 350 348 uint8_t *newdata = gdata + sizeof(GamestateHeader); 351 //uint8_t *origdata = GAMESTATE_START(data_);349 uint8_t *origdata = GAMESTATE_START(data_); 352 350 353 351 //copy the GamestateHeader … … 364 362 //copy in the zeros 365 363 for(it=dataMap_.begin(); it!=dataMap_.end(); it++){ 366 oldobjectheader = (synchronisableHeader*) (data_ + (*it).objDataOffset);364 oldobjectheader = (synchronisableHeader*)origdata; 367 365 newobjectheader = (synchronisableHeader*)newdata; 368 object = Synchronisable::getSynchronisable( (*it).objID );369 assert(object->objectID == oldobjectheader->objectID);366 // object = Synchronisable::getSynchronisable( (*it).objID ); 367 // assert(object->objectID == oldobjectheader->objectID); 370 368 objectsize = oldobjectheader->size; 371 *newobjectheader = *oldobjectheader;372 369 objectOffset=sizeof(synchronisableHeader); //skip the size and the availableData variables in the objectheader 373 if ( /*object->doSelection(HEADER->id)*/true ){ 370 if ( (*it).objID == oldobjectheader->objectID ){ 371 memcpy(newdata, origdata, objectsize); 374 372 assert(newobjectheader->dataAvailable==true); 375 memcpy(newdata+objectOffset, data_ + (*it).objDataOffset + objectOffset, objectsize-objectOffset);376 373 }else{ 374 *newobjectheader = *oldobjectheader; 377 375 newobjectheader->dataAvailable=false; 378 376 memset(newdata+objectOffset, 0, objectsize-objectOffset); 379 assert(objectOffset==objectsize);380 377 } 381 378 newdata += objectsize; 379 origdata += objectsize; 382 380 destsize += objectsize; 383 381 // origdata += objectsize; -
code/branches/presentation/src/network/synchronisable/Synchronisable.cc
r2415 r2417 170 170 { 171 171 mem += header->size; //.TODO: this suckz.... remove size from header 172 assert(0); 172 173 return 0; 173 174 }
Note: See TracChangeset
for help on using the changeset viewer.