Changeset 2759 for code/trunk/src/network/synchronisable
- Timestamp:
- Mar 8, 2009, 4:51:27 PM (16 years ago)
- Location:
- code/trunk/src/network/synchronisable
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/network/synchronisable/Synchronisable.cc
r2710 r2759 100 100 if (this->objectMode_ != 0x0 && (Host::running() && Host::isServer())) 101 101 deletedObjects_.push(objectID); 102 // COUT(3) << "destruct synchronisable +++" << objectID << " | " << classID << std::endl;103 // COUT(3) << " bump ---" << objectID << " | " << &objectMap_ << std::endl;104 // assert(objectMap_[objectID]->objectID==objectID);105 // objectMap_.erase(objectID);106 102 } 107 103 std::map<uint32_t, Synchronisable*>::iterator it; … … 110 106 objectMap_.erase(it); 111 107 112 //HACK HACK HACK HACK HACK HACK113 // this hack ensures that children of this object also get destroyed114 // ObjectList<Synchronisable>::iterator it2, it3;115 // // get total size of gamestate116 // for(it2 = ObjectList<Synchronisable>::begin(); it2; ++it2)117 // {118 // if ( it2->getCreatorID() == this->objectID && it2->getCreatorID() != OBJECTID_UNKNOWN )119 // {120 // Synchronisable::deleteObject( it2->getObjectID() );121 // }122 // }123 //HACK HACK HACK HACK HACK HACK124 108 } 125 109 … … 158 142 if (!id) 159 143 { 144 for(int i = 0; i<100; i++) 145 COUT(0) << "classid: " << i << " identifier: " << ClassByID(i) << endl; 160 146 COUT(0) << "Assertion failed: id" << std::endl; 161 147 COUT(0) << "Possible reason for this error: Client received a synchronizable object whose class has no factory." << std::endl; … … 203 189 */ 204 190 bool Synchronisable::deleteObject(uint32_t objectID){ 205 // assert(getSynchronisable(objectID));206 191 if(!getSynchronisable(objectID)) 207 192 return false; 208 193 assert(getSynchronisable(objectID)->objectID==objectID); 209 // delete objectMap_[objectID];210 194 Synchronisable *s = getSynchronisable(objectID); 211 195 if(s) … … 258 242 if(!doSync(id, mode)) 259 243 return true; 260 //std::cout << "inside getData" << std::endl;261 244 uint32_t tempsize = 0; 262 245 if (this->classID==0) … … 267 250 268 251 assert(this->classID==this->getIdentifier()->getNetworkID()); 269 // this->classID=this->getIdentifier()->getNetworkID(); // TODO: correct this270 252 std::list<SynchronisableVariableBase*>::iterator i; 271 253 uint32_t size; … … 305 287 mode=state_; 306 288 std::list<SynchronisableVariableBase *>::iterator i; 307 //assert(objectMode_!=0x0);308 //assert( (mode ^ objectMode_) != 0);309 289 if(syncList.empty()){ 310 290 assert(0); -
code/trunk/src/network/synchronisable/Synchronisable.h
r2710 r2759 142 142 protected: 143 143 Synchronisable(BaseObject* creator); 144 // void registerVariable(void *var, int size, variableType t, uint8_t mode=0x1, NetworkCallbackBase *cb=0);145 144 template <class T> void registerVariable(T& variable, uint8_t mode=0x1, NetworkCallbackBase *cb=0, bool bidirectional=false); 146 145 template <class T> void unregisterVariable(T& var); … … 205 204 template <> _NetworkExport void Synchronisable::registerVariable( const Quaternion& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional); 206 205 template <> _NetworkExport void Synchronisable::registerVariable( Quaternion& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional); 207 // template <> _NetworkExport void Synchronisable::registerVariable( LODParticle::LOD& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional);208 // template <> _NetworkExport void Synchronisable::registerVariable( Ogre::Light::LightTypes& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional);209 206 } 210 207
Note: See TracChangeset
for help on using the changeset viewer.