Changeset 2034 for code/branches/objecthierarchy/src/network
- Timestamp:
- Oct 28, 2008, 10:34:45 PM (16 years ago)
- Location:
- code/branches/objecthierarchy/src/network
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/network/GamestateManager.cc
r2006 r2034 80 80 // now push only the most recent gamestates we received (ignore obsolete ones) 81 81 for(it = gamestateQueue.begin(); it!=gamestateQueue.end(); it++){ 82 assert(processGamestate(it->second)); 82 bool b = processGamestate(it->second); 83 // assert(b); 83 84 delete it->second; 84 85 } -
code/branches/objecthierarchy/src/network/Synchronisable.cc
r2033 r2034 63 63 * Initializes all Variables and sets the right objectID 64 64 */ 65 Synchronisable::Synchronisable( ){65 Synchronisable::Synchronisable(orxonox::BaseObject* creator){ 66 66 RegisterRootObject(Synchronisable); 67 67 static uint32_t idCounter=0; … … 71 71 classID = (unsigned int)-1; 72 72 syncList = new std::list<synchronisableVariable *>; 73 74 this->creatorID = OBJECTID_UNKNOWN; 75 76 searchcreatorID: 77 if (creator) 78 { 79 if (creator->isA(Class(Synchronisable))) 80 { 81 Synchronisable* synchronisable_creator = dynamic_cast<Synchronisable*>(creator); 82 this->creatorID = synchronisable_creator->getObjectID(); 83 } 84 else if (creator != creator->getCreator()) 85 { 86 creator = creator->getCreator(); 87 goto searchcreatorID; 88 } 89 } 73 90 } 74 91 … … 134 151 orxonox::Identifier* id = ClassByID(header->classID); 135 152 assert(id); 136 orxonox::BaseObject *bo = id->fabricate(0); //TODO: get BaseObject* from header->creatorID here 153 orxonox::BaseObject* creator = 0; 154 if (header->creatorID != OBJECTID_UNKNOWN) 155 { 156 Synchronisable* synchronisable_creator = Synchronisable::getSynchronisable(header->creatorID); 157 if (!synchronisable_creator) 158 return 0; 159 else 160 creator = dynamic_cast<orxonox::BaseObject*>(synchronisable_creator); 161 } 162 orxonox::BaseObject *bo = id->fabricate(creator); 163 assert(bo); 137 164 Synchronisable *no = dynamic_cast<Synchronisable *>(bo); 138 165 assert(no); -
code/branches/objecthierarchy/src/network/Synchronisable.h
r2028 r2034 115 115 inline unsigned int getClassID(){return classID;} 116 116 protected: 117 Synchronisable( );117 Synchronisable(orxonox::BaseObject* creator); 118 118 void registerVar(void *var, int size, variableType t, int mode=1, NetworkCallbackBase *cb=0); 119 119 void setObjectMode(int mode); -
code/branches/objecthierarchy/src/network/packet/Gamestate.cc
r2031 r2034 158 158 { 159 159 s = Synchronisable::fabricate(mem, mode); 160 assert(s);160 return false; 161 161 // if(!s) 162 162 // return false;
Note: See TracChangeset
for help on using the changeset viewer.