Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2417


Ignore:
Timestamp:
Dec 12, 2008, 10:56:22 AM (16 years ago)
Author:
scheusso
Message:

further improvements in diffing (around 50% reduction of traffic)

Location:
code/branches/presentation/src/network
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation/src/network/packet/Gamestate.cc

    r2382 r2417  
    151151    if(!s)
    152152    {
    153       s = Synchronisable::fabricate(mem, mode);
    154       if(s==0)
    155         assert(0);
     153      Synchronisable::fabricate(mem, mode);
    156154//         COUT(0) << "could not fabricate synchronisable: " << objectheader->objectID << " classid: " << objectheader->classID << " creator: " << objectheader->creatorID << endl;
    157155//       else
     
    349347  Gamestate *gs = new Gamestate(gdata);
    350348  uint8_t *newdata = gdata + sizeof(GamestateHeader);
    351 //   uint8_t *origdata = GAMESTATE_START(data_);
     349  uint8_t *origdata = GAMESTATE_START(data_);
    352350
    353351  //copy the GamestateHeader
     
    364362  //copy in the zeros
    365363  for(it=dataMap_.begin(); it!=dataMap_.end(); it++){
    366     oldobjectheader = (synchronisableHeader*)(data_ + (*it).objDataOffset);
     364    oldobjectheader = (synchronisableHeader*)origdata;
    367365    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);
    370368    objectsize = oldobjectheader->size;
    371     *newobjectheader = *oldobjectheader;
    372369    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);
    374372      assert(newobjectheader->dataAvailable==true);
    375       memcpy(newdata+objectOffset, data_ + (*it).objDataOffset + objectOffset, objectsize-objectOffset);
    376373    }else{
     374      *newobjectheader = *oldobjectheader;
    377375      newobjectheader->dataAvailable=false;
    378376      memset(newdata+objectOffset, 0, objectsize-objectOffset);
    379       assert(objectOffset==objectsize);
    380377    }
    381378    newdata += objectsize;
     379    origdata += objectsize;
    382380    destsize += objectsize;
    383381//     origdata += objectsize;
  • code/branches/presentation/src/network/synchronisable/Synchronisable.cc

    r2415 r2417  
    170170      {
    171171        mem += header->size; //.TODO: this suckz.... remove size from header
     172        assert(0);
    172173        return 0;
    173174      }
Note: See TracChangeset for help on using the changeset viewer.