- Timestamp:
- May 24, 2018, 1:57:50 PM (7 years ago)
- Location:
- code/branches/Masterserver_FS18/src/libraries/network/synchronisable
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/Masterserver_FS18/src/libraries/network/synchronisable/Synchronisable.cc
r11907 r11983 43 43 std::queue<uint32_t> Synchronisable::deletedObjects_; 44 44 45 uint8_t Synchronisable::state_=0x1; // dete mines wheter we are server (default) or client45 uint8_t Synchronisable::state_=0x1; // determines wheter we are server (default) or client 46 46 47 47 RegisterAbstractClass(Synchronisable).inheritsFrom<OrxonoxInterface>(); … … 179 179 assert( Synchronisable::objectMap_.find(header.getObjectID()) == Synchronisable::objectMap_.end() ); 180 180 no->setObjectID(header.getObjectID()); 181 //no->contextID=header.getContextID(); //TODO: remove this182 181 no->setClassID(header.getClassID()); 183 182 assert(no->contextID_ == header.getContextID()); 184 //assert(no->classID_ == header.getClassID());185 183 orxout(verbose, context::network) << "fabricate objectID_: " << no->objectID_ << " classID_: " << no->classID_ << endl; 186 184 // update data and create object/entity... … … 189 187 if (b) 190 188 { 191 // b = no->create();192 189 assert(b); 193 190 } … … 273 270 274 271 orxout(verbose_more, context::network) << "getting data from objectID_: " << objectID_ << ", classID_: " << classID_ << endl; 275 // orxout(verbose, context::network) << "objectid: " << this->objectID_ << ":";276 272 // copy to location 277 273 for(SynchronisableVariableBase* variable : syncList_) 278 274 { 279 275 uint32_t varsize = variable->getData( mem, mode ); 280 // orxout(verbose, context::network) << " " << varsize;281 276 tempsize += varsize; 282 277 sizes.push_back(varsize); 283 278 ++test; 284 //tempsize += (*i)->getSize( mode );285 279 } 286 280 assert(tempsize!=0); // if this happens an empty object (with no variables) would be transmitted 287 // orxout(verbose, context::network) << endl;288 281 289 282 header.setObjectID( this->objectID_ ); … … 340 333 } 341 334 342 //orxout(verbose_more, context::network) << "Synchronisable: objectID_ " << syncHeader.getObjectID() << ", classID_ " << syncHeader.getClassID() << " size: " << syncHeader.getDataSize() << " synchronising data" << endl;343 335 if( !syncHeaderLight.isDiffed() ) 344 336 { … … 357 349 { 358 350 mem += SynchronisableHeaderLight::getSize(); 359 // orxout(debug_output, context::network) << "objectID: " << this->objectID_ << endl;360 351 while( mem < data+syncHeaderLight.getDataSize()+SynchronisableHeaderLight::getSize() ) 361 352 { 362 353 VariableID varID = *(VariableID*)mem; 363 // orxout(debug_output, context::network) << "varID: " << varID << endl;364 354 assert( varID < syncList_.size() ); 365 355 mem += sizeof(VariableID); … … 400 390 bool Synchronisable::doSync(/*int32_t id,*/ uint8_t mode) 401 391 { 402 // if(mode==0x0)403 // mode=state_;404 392 assert(mode!=0x0); 405 393 return ( (this->objectMode_ & mode)!=0 && (!syncList_.empty() ) ); -
code/branches/Masterserver_FS18/src/libraries/network/synchronisable/Synchronisable.h
r11071 r11983 134 134 { memcpy(data_, h.data_, getSize()); } 135 135 }; 136 137 // inline void operator=(SynchronisableHeaderLight& h1, SynchronisableHeader& h2)138 // {139 // memcpy(h1.data_, h2.data_, h1.getSize());140 // }141 136 142 137 /**
Note: See TracChangeset
for help on using the changeset viewer.