Changeset 6424 in orxonox.OLD for trunk/src/world_entities/space_ships
- Timestamp:
- Jan 7, 2006, 11:07:22 PM (19 years ago)
- Location:
- trunk/src/world_entities/space_ships
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/space_ships/space_ship.cc
r6341 r6424 31 31 #include "key_mapper.h" 32 32 #include "event_handler.h" 33 34 #include "network_game_manager.h" 33 35 34 36 #include "power_ups/weapon_power_up.h" … … 121 123 PRINTF(4)("SPACESHIP INIT\n"); 122 124 123 //EventHandler::getInstance()->grabEvents(true);125 EventHandler::getInstance()->grabEvents(true); 124 126 125 127 bUp = bDown = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = false; … … 516 518 } 517 519 } 520 521 522 int SpaceShip::writeBytes( const byte * data, int length, int sender ) 523 { 524 setRequestedSync( false ); 525 setIsOutOfSync( false ); 526 527 SYNCHELP_READ_BEGIN(); 528 529 SYNCHELP_READ_FKT( WorldEntity::writeState ); 530 531 return SYNCHELP_READ_N; 532 } 533 534 int SpaceShip::readBytes( byte * data, int maxLength, int * reciever ) 535 { 536 if ( isOutOfSync() && !requestedSync() && this->getHostID()!=this->getOwner() ) 537 { 538 (NetworkGameManager::getInstance())->sync( this->getUniqueID(), this->getOwner() ); 539 setRequestedSync( true ); 540 } 541 542 int rec = this->getRequestSync(); 543 if ( rec > 0 ) 544 { 545 *reciever = rec; 546 547 SYNCHELP_WRITE_BEGIN(); 548 549 SYNCHELP_WRITE_FKT( WorldEntity::readState ); 550 551 return SYNCHELP_WRITE_N; 552 } 553 554 *reciever = 0; 555 return 0; 556 } -
trunk/src/world_entities/space_ships/space_ship.h
r6243 r6424 44 44 bool pickup(PowerUp* powerUp); 45 45 46 virtual int writeBytes(const byte* data, int length, int sender); 47 virtual int readBytes(byte* data, int maxLength, int * reciever); 48 46 49 47 50 private:
Note: See TracChangeset
for help on using the changeset viewer.