Changeset 6341 in orxonox.OLD for trunk/src/world_entities/weapons
- Timestamp:
- Dec 30, 2005, 1:57:12 AM (19 years ago)
- Location:
- trunk/src/world_entities/weapons
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/weapons/ground_turret.cc
r6142 r6341 19 19 20 20 #include "factory.h" 21 #include "network_game_manager.h" 21 22 #include "load_param.h" 22 23 … … 168 169 169 170 } 171 172 /** 173 * Writes data from network containing information about the state 174 * @param data pointer to data 175 * @param length length of data 176 * @param sender hostID of sender 177 */ 178 int GroundTurret::writeBytes( const byte * data, int length, int sender ) 179 { 180 setRequestedSync( false ); 181 setIsOutOfSync( false ); 182 183 SYNCHELP_READ_BEGIN(); 184 185 SYNCHELP_READ_FKT( WorldEntity::writeState ); 186 187 return SYNCHELP_READ_N; 188 } 189 190 /** 191 * data copied in data will bee sent to another host 192 * @param data pointer to data 193 * @param maxLength max length of data 194 * @return the number of bytes writen 195 */ 196 int GroundTurret::readBytes( byte * data, int maxLength, int * reciever ) 197 { 198 SYNCHELP_WRITE_BEGIN(); 199 200 if ( isOutOfSync() && !requestedSync() && this->getHostID()!=this->getOwner() ) 201 { 202 (NetworkGameManager::getInstance())->sync( this->getUniqueID(), this->getOwner() ); 203 setRequestedSync( true ); 204 } 205 206 int rec = this->getRequestSync(); 207 if ( rec > 0 ) 208 { 209 *reciever = rec; 210 211 SYNCHELP_WRITE_FKT( WorldEntity::readState ); 212 213 } 214 215 *reciever = 0; 216 return SYNCHELP_WRITE_N; 217 } -
trunk/src/world_entities/weapons/ground_turret.h
r5819 r6341 30 30 virtual void collidesWith (WorldEntity* entity, const Vector& location); 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 private: 33 36 Weapon *left, *right;
Note: See TracChangeset
for help on using the changeset viewer.