- Timestamp:
- Jan 6, 2006, 6:41:59 PM (19 years ago)
- Location:
- branches/network/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/network_game_manager.cc
r6419 r6420 734 734 } 735 735 736 PNode::getNullParent()->debugNode( 0 );737 738 736 return true; 739 737 } -
branches/network/src/world_entities/power_ups/param_power_up.cc
r6419 r6420 25 25 #include "factory.h" 26 26 #include "load_param.h" 27 #include "network_game_manager.h" 27 28 28 29 using namespace std; … … 119 120 } 120 121 122 int ParamPowerUp::writeBytes( const byte * data, int length, int sender ) 123 { 124 setRequestedSync( false ); 125 setIsOutOfSync( false ); 121 126 127 SYNCHELP_READ_BEGIN(); 128 129 SYNCHELP_READ_FKT( PowerUp::writeState ); 130 131 return SYNCHELP_READ_N; 132 } 133 134 135 136 int ParamPowerUp::readBytes( byte * data, int maxLength, int * reciever ) 137 { 138 if ( isOutOfSync() && !requestedSync() && this->getHostID()!=this->getOwner() ) 139 { 140 (NetworkGameManager::getInstance())->sync( this->getUniqueID(), this->getOwner() ); 141 setRequestedSync( true ); 142 } 143 144 int rec = this->getRequestSync(); 145 if ( rec > 0 ) 146 { 147 *reciever = rec; 148 149 SYNCHELP_WRITE_BEGIN(); 150 151 SYNCHELP_WRITE_FKT( PowerUp::readState ); 152 153 return SYNCHELP_WRITE_N; 154 } 155 156 *reciever = 0; 157 return 0; 158 } 159 -
branches/network/src/world_entities/power_ups/param_power_up.h
r6113 r6420 30 30 int getValue(); 31 31 32 virtual int writeBytes(const byte* data, int length, int sender); 33 virtual int readBytes(byte* data, int maxLength, int * reciever ); 34 32 35 protected: 33 36 virtual void respawn(); -
branches/network/src/world_entities/space_ships/space_ship.cc
r6417 r6420 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" … … 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 } -
branches/network/src/world_entities/space_ships/space_ship.h
r6243 r6420 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: -
branches/network/src/world_entities/terrain.cc
r6414 r6420 327 327 SYNCHELP_READ_FKT( WorldEntity::writeState ); 328 328 329 PNode::getNullParent()->debugNode( 0 );330 331 329 return SYNCHELP_READ_N; 332 330 }
Note: See TracChangeset
for help on using the changeset viewer.