Changeset 8329
- Timestamp:
- Apr 26, 2011, 12:31:32 AM (14 years ago)
- Location:
- code/trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/libraries/network/synchronisable/Synchronisable.cc
r8327 r8329 236 236 mode=state_; 237 237 //if this tick is we dont synchronise, then abort now 238 if(!doSync( id,mode))238 if(!doSync(/*id,*/ mode)) 239 239 return 0; 240 240 uint32_t tempsize = 0; … … 302 302 if(mode==0x0) 303 303 mode=state_; 304 304 305 if(syncList_.empty()) 305 306 { … … 313 314 SynchronisableHeaderLight syncHeaderLight(mem); 314 315 assert(syncHeaderLight.getObjectID()==this->getObjectID()); 316 317 if( !this->doReceive(mode) ) 318 { 319 uint32_t headerSize; 320 if( syncHeaderLight.isDiffed() ) 321 headerSize = SynchronisableHeaderLight::getSize(); 322 else 323 headerSize = SynchronisableHeader::getSize(); 324 mem += syncHeaderLight.getDataSize() + headerSize; 325 return true; 326 } 315 327 316 328 //COUT(5) << "Synchronisable: objectID_ " << syncHeader.getObjectID() << ", classID_ " << syncHeader.getClassID() << " size: " << syncHeader.getDataSize() << " synchronising data" << std::endl; … … 357 369 if (mode==0x0) 358 370 mode=state_; 359 if (!doSync( id,mode))371 if (!doSync(/*id, */mode)) 360 372 return 0; 361 373 assert( mode==state_ ); … … 375 387 * @return true/false 376 388 */ 377 bool Synchronisable::doSync( int32_t id,uint8_t mode)389 bool Synchronisable::doSync(/*int32_t id,*/ uint8_t mode) 378 390 { 379 391 // if(mode==0x0) … … 381 393 assert(mode!=0x0); 382 394 return ( (this->objectMode_ & mode)!=0 && (!syncList_.empty() ) ); 395 } 396 397 /** 398 * This function determines, wheter the object should accept data from the bytestream (according to its syncmode/direction) 399 * @param id gamestate id 400 * @param mode Synchronisation mode (toclient, toserver or bidirectional) 401 * @return true/false 402 */ 403 bool Synchronisable::doReceive( uint8_t mode) 404 { 405 //return mode != this->objectMode_ || this->objectMode_ == ObjectDirection::Bidirectional; 406 return true; 383 407 } 384 408 -
code/trunk/src/libraries/network/synchronisable/Synchronisable.h
r8314 r8329 180 180 uint32_t getSize(int32_t id, uint8_t mode=0x0); 181 181 bool updateData(uint8_t*& mem, uint8_t mode=0x0, bool forceCallback=false); 182 bool doSync(int32_t id, uint8_t mode=0x0); 182 bool doSync(/*int32_t id,*/ uint8_t mode=0x0); 183 bool doReceive( uint8_t mode ); 183 184 184 185 inline void setObjectID(uint32_t id){ this->objectID_ = id; objectMap_[this->objectID_] = this; } -
code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
r7889 r8329 89 89 90 90 this->isHumanShip_ = this->hasLocalController(); 91 92 this->setSyncMode(ObjectDirection::Bidirectional); // needed to synchronise e.g. aimposition 91 93 } 92 94
Note: See TracChangeset
for help on using the changeset viewer.