Changeset 7444 in orxonox.OLD for branches/network/src/world_entities/npcs
- Timestamp:
- Apr 29, 2006, 1:57:48 PM (19 years ago)
- Location:
- branches/network/src/world_entities/npcs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/world_entities/npcs/ground_turret.cc
r7193 r7444 180 180 Explosion::explode(this, Vector(10,10,10)); 181 181 } 182 183 /**184 * Writes data from network containing information about the state185 * @param data pointer to data186 * @param length length of data187 * @param sender hostID of sender188 */189 int GroundTurret::writeBytes( const byte * data, int length, int sender )190 {191 setRequestedSync( false );192 setIsOutOfSync( false );193 194 SYNCHELP_READ_BEGIN();195 196 SYNCHELP_READ_FKT( WorldEntity::writeState, NWT_GT_WE_STATE );197 198 return SYNCHELP_READ_N;199 }200 201 /**202 * data copied in data will bee sent to another host203 * @param data pointer to data204 * @param maxLength max length of data205 * @return the number of bytes writen206 */207 int GroundTurret::readBytes( byte * data, int maxLength, int * reciever )208 {209 SYNCHELP_WRITE_BEGIN();210 211 if ( isOutOfSync() && !requestedSync() && this->getHostID()!=this->getOwner() )212 {213 (NetworkGameManager::getInstance())->sync( this->getUniqueID(), this->getOwner() );214 setRequestedSync( true );215 }216 217 int rec = this->getRequestSync();218 if ( rec > 0 )219 {220 *reciever = rec;221 222 SYNCHELP_WRITE_FKT( WorldEntity::readState, NWT_GT_WE_STATE );223 224 }225 226 *reciever = 0;227 return SYNCHELP_WRITE_N;228 } -
branches/network/src/world_entities/npcs/ground_turret.h
r7102 r7444 30 30 virtual void tick(float time); 31 31 32 virtual int writeBytes(const byte* data, int length, int sender);33 virtual int readBytes(byte* data, int maxLength, int * reciever);34 35 32 private: 36 33 PNode weaponHolder[2];
Note: See TracChangeset
for help on using the changeset viewer.