Changeset 6424 in orxonox.OLD for trunk/src/lib
- Timestamp:
- Jan 7, 2006, 11:07:22 PM (19 years ago)
- Location:
- trunk/src/lib
- Files:
-
- 6 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/Makefile.am
r6074 r6424 36 36 lang/base_object.cc \ 37 37 lang/class_list.cc \ 38 data/data_tank.cc \ 38 39 util/substring.cc \ 39 40 util/color.cc \ … … 47 48 noinst_HEADERS = coord/p_node.h \ 48 49 lang/base_object.h \ 50 data/data_tank.h \ 49 51 graphics/render2D/element_2d.h \ 50 52 graphics/render2D/render_2d.h \ … … 70 72 particles \ 71 73 collision_detection \ 72 network \74 network \ 73 75 parser \ 74 76 shell \ -
trunk/src/lib/coord/p_node.cc
r6341 r6424 29 29 30 30 #include "synchronizeable.h" 31 32 #include "shell_command.h" 33 SHELL_COMMAND(debugNode, PNode, debugNodeSC); 31 34 32 35 using namespace std; … … 152 155 } 153 156 } 157 158 159 /** 160 * init the pnode to a well definied state 161 * 162 * this function actualy only updates the PNode tree 163 */ 164 void PNode::init() 165 { 166 /* just update all aboslute positions via timestep 0.001ms */ 167 this->updateNode(0.001f); 168 this->updateNode(0.001f); 169 } 170 154 171 155 172 /** -
trunk/src/lib/coord/p_node.h
r6341 r6424 78 78 79 79 void loadParams(const TiXmlElement* root); 80 81 void init(); 80 82 81 83 // ACTIVATION // … … 172 174 // DEBUG // 173 175 void countChildNodes(int& nodes) const; 176 void debugNodeSC (unsigned int depth = 1, unsigned int level = 0) { this->debugNode(depth, level); }; 174 177 void debugNode (unsigned int depth = 1, unsigned int level = 0) const; 175 178 void debugDraw(unsigned int depth = 1, float size = 1.0, const Vector& color = Vector(1, 0, 0), unsigned int level = 0) const; -
trunk/src/lib/network/network_game_manager.cc
r6341 r6424 23 23 #include "network_stream.h" 24 24 #include "converter.h" 25 26 #include "p_node.h" 27 25 28 26 29 /* include your own header */ … … 237 240 * @param classID: The ID of the class of which an entity should be created 238 241 */ 239 BaseObject* NetworkGameManager::createEntity( TiXmlElement* element)242 BaseObject* NetworkGameManager::createEntity(const TiXmlElement* element) 240 243 { 241 244 if ( this->isServer() ) … … 252 255 if ( !b ) 253 256 { 254 PRINTF(1)("Could not fabricate Object with class ID %x\n", element->Value() );257 PRINTF(1)("Could not fabricate Object with className %s\n", element->Value() ); 255 258 return NULL; 256 259 } … … 391 394 //PRINTF(0)("SendEntityList: n = %d\n", networkStream->getSyncCount()-2 ); 392 395 396 int n = 0; 397 393 398 while ( it != e ) 394 399 { … … 403 408 if ( !writeToClientBuffer( outBuffer[userID], (int)((*it)->getOwner()) ) ) 404 409 return; 410 411 412 PRINTF(0)("id = %x %s %s\n", (int)((*it)->getLeafClassID()), (*it)->getClassName(), (*it)->getName()); 413 414 415 /*if ( (*it)->isA(CL_WORLD_ENTITY) ) 416 { 417 n = dynamic_cast<WorldEntity*>((*it))->readState( outBuffer[userID].buffer, outBuffer[userID].maxLength-outBuffer[userID].length ); 418 if ( n = 0 ) 419 { 420 PRINTF(2)("n = 0\n"); 421 } 422 outBuffer[userID].length += n; 423 }*/ 405 424 406 425 it++; … … 436 455 * @param owner: owner of this synchronizealbe 437 456 */ 438 voidNetworkGameManager::doCreateEntity( ClassID classID, int uniqueID, int owner )457 BaseObject* NetworkGameManager::doCreateEntity( ClassID classID, int uniqueID, int owner ) 439 458 { 440 459 BaseObject * b = Factory::fabricate( classID ); … … 443 462 { 444 463 PRINTF(1)("Could not fabricate Object with classID %x\n", classID); 445 return ;464 return NULL; 446 465 } 447 466 … … 455 474 s->setIsOutOfSync( true ); 456 475 PRINTF(0)("Fabricated %s with id %d\n", s->getClassName(), s->getUniqueID()); 476 return b; 457 477 } 458 478 else … … 461 481 delete b; 462 482 } 483 return NULL; 463 484 } 464 485 … … 695 716 i += Converter::byteArrayToInt( &data[i], &owner ); 696 717 718 PRINTF(0)("before fabricate\n"); 697 719 if ( classID != CL_NETWORK_GAME_MANAGER && classID != CL_HANDSHAKE ) 698 doCreateEntity( (ClassID)classID, uniqueID, owner ); 699 700 } 720 { 721 BaseObject* b = doCreateEntity( (ClassID)classID, uniqueID, owner ); 722 723 /*if ( b != NULL ) 724 { 725 if ( b->isA(CL_WORLD_ENTITY) ) 726 { 727 int n = dynamic_cast<WorldEntity*>(b)->writeState( data, length, sender ); 728 729 i += n; 730 } 731 }*/ 732 } 733 734 } 735 701 736 return true; 702 737 } -
trunk/src/lib/network/network_game_manager.h
r6341 r6424 75 75 76 76 void createEntity( ClassID classID, int owner = 0 ); 77 BaseObject* createEntity( TiXmlElement* element);77 BaseObject* createEntity(const TiXmlElement* element); 78 78 void removeEntity( int uniqueID ); 79 79 void sendYouAre( int uniqueID, int userID ); … … 94 94 void executeRequestSync( int uniqueID, int user ); 95 95 96 voiddoCreateEntity(ClassID classID, int uniqueID, int owner);96 BaseObject* doCreateEntity(ClassID classID, int uniqueID, int owner); 97 97 void doRemoveEntity(int uniqueID); 98 98 void doRequestSync(int uniqueID, int userID); -
trunk/src/lib/network/synchronizeable.cc
r6341 r6424 36 36 this->networkStream = NULL; 37 37 this->setRequestedSync( false ); 38 this->setIsOutOfSync( !(this->isServer()) ); 38 39 } 39 40
Note: See TracChangeset
for help on using the changeset viewer.