Changeset 3198 for code/trunk/src/network/synchronisable
- Timestamp:
- Jun 20, 2009, 4:27:38 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/network/synchronisable/Synchronisable.cc
r3088 r3198 98 98 // delete callback function objects 99 99 if(!Identifier::isCreatingHierarchy()){ 100 // remove object from the static objectMap 101 if (this->objectMode_ != 0x0 && (Host::running() && Host::isServer())) 102 deletedObjects_.push(objectID); 103 // delete all Synchronisable Variables from syncList ( which are also in stringList ) 100 104 for(std::vector<SynchronisableVariableBase*>::iterator it = syncList.begin(); it!=syncList.end(); it++) 101 105 delete (*it); 102 if (this->objectMode_ != 0x0 && (Host::running() && Host::isServer()))103 deletedObjects_.push(objectID);106 syncList.clear(); 107 stringList.clear(); 104 108 } 105 109 std::map<uint32_t, Synchronisable*>::iterator it; … … 174 178 COUT(4) << "fabricate objectID: " << no->objectID << " classID: " << no->classID << std::endl; 175 179 // update data and create object/entity... 180 assert( Synchronisable::objectMap_.find(header.getObjectID()) == Synchronisable::objectMap_.end() ); 181 Synchronisable::objectMap_[header.getObjectID()] = no; 176 182 bool b = no->updateData(mem, mode, true); 177 183 assert(b); … … 213 219 return it1->second; 214 220 215 ObjectList<Synchronisable>::iterator it; 216 for(it = ObjectList<Synchronisable>::begin(); it; ++it){ 217 if( it->getObjectID()==objectID ){ 218 objectMap_[objectID] = *it; 219 return *it; 220 } 221 } 221 // ObjectList<Synchronisable>::iterator it; 222 // for(it = ObjectList<Synchronisable>::begin(); it; ++it){ 223 // if( it->getObjectID()==objectID ){ 224 // objectMap_[objectID] = *it; 225 // return *it; 226 // } 227 // } 228 // if the objects not in the map it should'nt exist at all anymore 222 229 return NULL; 223 230 }
Note: See TracChangeset
for help on using the changeset viewer.