Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 8, 2009, 4:40:01 PM (15 years ago)
Author:
scheusso
Message:

some cleanup (mostly comments)

File:
1 edited

Legend:

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

    r2710 r2758  
    4848#define PACKET_FLAG_GAMESTATE  ENET_PACKET_FLAG_RELIABLE
    4949
    50 // Gamestate::Gamestate()
    51 // {
    52 //   flags_ = flags_ | PACKET_FLAG_GAMESTATE;
    53 // }
    5450
    5551Gamestate::Gamestate()
     
    127123#endif
    128124
    129     //if(it->doSelection(id))
    130125    if ( it->doSync( id, mode ) )
    131126      dataMap_.push_back( obj(it->getObjectID(), it->getCreatorID(), tempsize, mem-data_) );
    132 //     dataMap_[mem-data_]=(*it);  // save the mem location of the synchronisable data
    133127    if(!it->getData(mem, id, mode))
    134128      return false; // mem pointer gets automatically increased because of call by reference
     
    158152  assert(!header_->isDiffed());
    159153  uint8_t *mem=data_+GamestateHeader::getSize();
    160     // get the start of the Synchronisable list
    161   //ObjectList<Synchronisable>::iterator it=ObjectList<Synchronisable>::begin();
    162154  Synchronisable *s;
    163155
     
    177169        mem += objectheader.getDataSize();
    178170      }
    179 //         COUT(0) << "could not fabricate synchronisable: " << objectheader->objectID << " classid: " << objectheader->classID << " creator: " << objectheader->creatorID << endl;
    180 //       else
    181 //         COUT(0) << "fabricated: " << objectheader->objectID << " classid: " << objectheader->classID << " creator: "  << objectheader->creatorID << endl;
    182171    }
    183172    else
    184173    {
    185174      bool b = s->updateData(mem, mode);
    186 //      if(!b)
    187 //        COUT(0) << "data could not be updated" << endl;
    188175      assert(b);
    189176    }
     
    262249  uint8_t *ndata = new uint8_t[buffer+GamestateHeader::getSize()];
    263250  uint8_t *dest = ndata + GamestateHeader::getSize();
    264   //unsigned char *dest = new unsigned char[buffer];
    265251  uint8_t *source = data_ + GamestateHeader::getSize();
    266252  int retval;
     
    294280  uint32_t compsize = header_->getCompSize();
    295281  uint32_t bufsize;
    296 //  assert(compsize<=datasize);
    297282  bufsize = datasize;
    298283  assert(bufsize!=0);
     
    340325  assert(!header_->isDiffed());
    341326  GamestateHeader diffHeader(base->data_);
    342   //unsigned char *basep = base->getGs()/*, *gs = getGs()*/;
    343327  uint8_t *basep = GAMESTATE_START(base->data_), *gs = GAMESTATE_START(this->data_);
    344328  uint32_t of=0; // pointers offset
     
    397381  //copy in the zeros
    398382  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 this
    402 //      continue;                            // merged from objecthierarchy2, doesn't work anymore; TODO: change this
    403383    SynchronisableHeader oldobjectheader(origdata);
    404384    SynchronisableHeader newobjectheader(newdata);
     
    408388      continue;
    409389    }
    410 //     object = Synchronisable::getSynchronisable( (*it).objID );
    411 //     assert(object->objectID == oldobjectheader->objectID);
    412390    objectsize = oldobjectheader.getDataSize();
    413391    objectOffset=SynchronisableHeader::getSize(); //skip the size and the availableData variables in the objectheader
     
    447425  assert(header_->isDiffed());
    448426  assert(!header_->isCompressed() && !base->header_->isCompressed());
    449   //unsigned char *basep = base->getGs()/*, *gs = getGs()*/;
    450427  uint8_t *basep = GAMESTATE_START(base->data_);
    451428  uint8_t *gs = GAMESTATE_START(this->data_);
Note: See TracChangeset for help on using the changeset viewer.