Changeset 6420 in orxonox.OLD for branches/network/src/world_entities/power_ups
- Timestamp:
- Jan 6, 2006, 6:41:59 PM (19 years ago)
- Location:
- branches/network/src/world_entities/power_ups
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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();
Note: See TracChangeset
for help on using the changeset viewer.