Changeset 324
- Timestamp:
- Nov 28, 2007, 4:07:13 PM (17 years ago)
- Location:
- code/branches/network/src/network
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/src/network/GameStateManager.cc
r314 r324 90 90 if(it->objectID!=sync.objectID){ 91 91 // bad luck ;) 92 // delete the synchronisable (obviously seems to be deleted on the server) 93 while(it=!0 && it->objectID!=sync.objectID){ 94 it=removeObject(it); 95 } 96 if(it==0){ // add the new object 97 98 } 92 99 } else { 93 100 // we have our object 94 101 if(! it->updateData(sync)) 95 std::cout << "We couldn't update objectID: " << sync.objectID << "; classID: " << sync.classID << std::endl; 102 std::cout << "We couldn't update objectID: " \ 103 << sync.objectID << "; classID: " << sync.classID << std::endl; 96 104 } 105 97 106 } 107 98 108 99 109 } 100 110 101 111 /** 112 * This function removes a Synchronisable out of the universe 113 * @param it iterator of the list pointing to the object 114 * @return iterator pointing to the next object in the list 115 */ 116 Iterator<Synchronisable> removeObject(Iterator<Synchronisable> it){ 117 Iterator<Synchronisable> temp=it; 118 it++; 119 delete temp; 120 return it; 121 } 102 122 103 123 -
code/branches/network/src/network/Synchronisable.h
r314 r324 43 43 Synchronisable(); 44 44 45 ~Synchronisable();45 virtual ~Synchronisable(); 46 46 int objectID; 47 47 int classID; … … 55 55 56 56 private: 57 bool removeObject(Iterator<Synchronisable> it); 58 57 59 std::list<SYNCVAR> syncList; 58 60 int datasize;
Note: See TracChangeset
for help on using the changeset viewer.