- Timestamp:
- May 30, 2018, 2:56:24 PM (7 years ago)
- Location:
- code/branches/PresentationFS18
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/PresentationFS18
- Property svn:mergeinfo changed
/code/branches/Masterserver_FS18 (added) merged: 11816,11829,11842,11856,11858,11880,11889,11905,11907,11910,11929-11930,11937,11962-11963,11973,11983,11990
- Property svn:mergeinfo changed
-
code/branches/PresentationFS18/src/libraries/network/synchronisable/Synchronisable.cc
r11103 r12020 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>(); … … 53 53 Synchronisable::Synchronisable(Context* context) 54 54 { 55 55 RegisterObject(Synchronisable); 56 56 static uint32_t idCounter=0; 57 57 objectMode_=0x1; // by default do not send data to server … … 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/PresentationFS18/src/libraries/network/synchronisable/Synchronisable.h
r11071 r12020 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.