Changeset 6257 in orxonox.OLD for branches/network/src/lib
- Timestamp:
- Dec 21, 2005, 11:58:57 PM (19 years ago)
- Location:
- branches/network/src/lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/lang/base_object.cc
r6077 r6257 75 75 this->classID |= (long)classID; 76 76 this->className = className; 77 this->realClassID = classID; 77 78 78 79 ClassList::addToClassList(this, classID, className); -
branches/network/src/lib/lang/base_object.h
r6077 r6257 34 34 /** @returns the classID of the corresponding Object */ 35 35 inline int getClassID() const { return this->classID; }; 36 inline int getRealClassID() const { return this->realClassID; }; 36 37 37 38 bool isA (ClassID classID) const; … … 49 50 const char* className; //!< the name of the class 50 51 long classID; //!< this is the id from the class_id.h enumeration 52 long realClassID; //!< classID which can be used with factory 51 53 char* objectName; //!< The name of this object 52 54 }; -
branches/network/src/lib/network/network_game_manager.cc
r6256 r6257 41 41 42 42 /* set the class id for the base object */ 43 this->setClassID(CL_ ENTITY_MANAGER, "EntityManager");43 this->setClassID(CL_NETWORK_GAME_MANAGER, "EntityManager"); 44 44 45 45 allOutBuffer.length = 0; … … 145 145 for ( int i = 0; i<outBuffer.size(); i++ ) 146 146 { 147 *reciever = i; 147 148 if ( outBuffer[i].length>0 ) 148 149 { 149 150 int nbytes = outBuffer[i].length; 151 outBuffer[i].length = 0; 150 152 151 153 if ( nbytes > maxLength ) … … 160 162 } 161 163 164 *reciever = 0; 162 165 int nbytes = allOutBuffer.length; 166 allOutBuffer.length = 0; 163 167 164 168 if ( nbytes <=0 ) … … 360 364 return; 361 365 362 if ( !writeToClientBuffer( outBuffer[userID], networkStream->getSyncCount() ) ) 363 return; 364 365 PRINTF(0)("SendEntityList: n = %d\n", networkStream->getSyncCount()); 366 // -2 because you must not send network_game_manager and handshake 367 if ( !writeToClientBuffer( outBuffer[userID], networkStream->getSyncCount()-2 ) ) 368 return; 369 370 PRINTF(0)("SendEntityList: n = %d\n", networkStream->getSyncCount()-2 ); 366 371 367 372 while ( it != e ) 368 373 { 369 if ( !writeToClientBuffer( outBuffer[userID], (*it)->getClassID() ) ) 370 return; 371 372 PRINTF(0)("SendEntityList: ClassID = %x\n", (*it)->getClassID()); 373 374 if ( !writeToClientBuffer( outBuffer[userID], (*it)->getUniqueID() ) ) 375 return; 376 377 if ( !writeToClientBuffer( outBuffer[userID], (*it)->getOwner() ) ) 378 return; 374 if ( (*it)->getRealClassID() != CL_NETWORK_GAME_MANAGER && (*it)->getRealClassID() != CL_HANDSHAKE ) 375 { 376 377 if ( !writeToClientBuffer( outBuffer[userID], (*it)->getRealClassID() ) ) 378 return; 379 380 PRINTF(0)("SendEntityList: ClassID = %x\n", (*it)->getRealClassID()); 381 382 if ( !writeToClientBuffer( outBuffer[userID], (*it)->getUniqueID() ) ) 383 return; 384 385 if ( !writeToClientBuffer( outBuffer[userID], (*it)->getOwner() ) ) 386 return; 387 } 379 388 380 389 it++;
Note: See TracChangeset
for help on using the changeset viewer.