Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 29, 2006, 1:57:48 PM (18 years ago)
Author:
rennerc
Message:

new network system implemented. yet with a lot of empty function bodys

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/world_entities/npcs/ground_turret.cc

    r7193 r7444  
    180180  Explosion::explode(this, Vector(10,10,10));
    181181}
    182 
    183 /**
    184  * Writes data from network containing information about the state
    185  * @param data pointer to data
    186  * @param length length of data
    187  * @param sender hostID of sender
    188  */
    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 host
    203  * @param data pointer to data
    204  * @param maxLength max length of data
    205  * @return the number of bytes writen
    206  */
    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 }
Note: See TracChangeset for help on using the changeset viewer.