Changeset 3003 for code/branches/netp3/src/network/packet
- Timestamp:
- May 21, 2009, 12:55:44 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/netp3/src/network/packet/Gamestate.cc
r2990 r3003 179 179 } 180 180 } 181 182 181 // In debug mode, check first, whether there are no duplicate objectIDs 183 182 #ifndef NDEBUG 184 ObjectList<Synchronisable>::iterator it; 185 for (it = ObjectList<Synchronisable>::begin(); it != ObjectList<Synchronisable>::end(); ++it) { 186 if (it->getObjectID() == OBJECTID_UNKNOWN) { 187 if (it->objectMode_ != 0x0) { 188 COUT(0) << "Found object with OBJECTID_UNKNOWN on the client with objectMode != 0x0!" << std::endl; 189 COUT(0) << "Possible reason for this error: Client created a synchronized object without the Server's approval." << std::endl; 190 COUT(0) << "Objects class: " << it->getIdentifier()->getName() << std::endl; 191 assert(false); 192 } 193 } 194 else { 195 ObjectList<Synchronisable>::iterator it2; 196 for (it2 = ObjectList<Synchronisable>::begin(); it2 != ObjectList<Synchronisable>::end(); ++it2) { 197 if (it->getObjectID() == it2->getObjectID() && *it != *it2) { 198 COUT(0) << "Found duplicate objectIDs on the client!" << std::endl 199 << "Are you sure you don't create a Sychnronisable objcect with 'new' \ 200 that doesn't have objectMode = 0x0?" << std::endl; 201 assert(false); 183 if(this->getID()%1000==0){ 184 std::vector<uint32_t> v1; 185 ObjectList<Synchronisable>::iterator it; 186 for (it = ObjectList<Synchronisable>::begin(); it != ObjectList<Synchronisable>::end(); ++it) { 187 if (it->getObjectID() == OBJECTID_UNKNOWN) { 188 if (it->objectMode_ != 0x0) { 189 COUT(0) << "Found object with OBJECTID_UNKNOWN on the client with objectMode != 0x0!" << std::endl; 190 COUT(0) << "Possible reason for this error: Client created a synchronized object without the Server's approval." << std::endl; 191 COUT(0) << "Objects class: " << it->getIdentifier()->getName() << std::endl; 192 assert(false); 202 193 } 194 } 195 else { 196 std::vector<uint32_t>::iterator it2; 197 for (it2 = v1.begin(); it2 != v1.end(); ++it2) { 198 if (it->getObjectID() == *it2) { 199 COUT(0) << "Found duplicate objectIDs on the client!" << std::endl 200 << "Are you sure you don't create a Sychnronisable objcect with 'new' \ 201 that doesn't have objectMode = 0x0?" << std::endl; 202 assert(false); 203 } 204 } 205 v1.push_back(it->getObjectID()); 203 206 } 204 207 }
Note: See TracChangeset
for help on using the changeset viewer.