Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 25, 2006, 1:35:29 AM (19 years ago)
Author:
patrick
Message:

network: some more degbug ability for pnode, started work on water synchronization

Location:
branches/network/src/world_entities/environments
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/world_entities/environments/water.cc

    r6610 r6685  
    219219  this->grid->rebuildNormals(this->height);
    220220}
     221
     222
     223/**
     224 * Writes data from network containing information about the state
     225 * @param data pointer to data
     226 * @param length length of data
     227 * @param sender hostID of sender
     228 */
     229int Water::writeBytes( const byte * data, int length, int sender )
     230{
     231//   setRequestedSync( false );
     232//   setIsOutOfSync( false );
     233//
     234//   SYNCHELP_READ_BEGIN();
     235//
     236//   SYNCHELP_READ_FKT( WorldEntity::writeState );
     237//
     238//   return SYNCHELP_READ_N;
     239}
     240
     241
     242/**
     243 * data copied in data will bee sent to another host
     244 * @param data pointer to data
     245 * @param maxLength max length of data
     246 * @return the number of bytes writen
     247 */
     248int Water::readBytes( byte * data, int maxLength, int * reciever )
     249{
     250//   SYNCHELP_WRITE_BEGIN();
     251//
     252//   if ( isOutOfSync() && !requestedSync() && this->getHostID()!=this->getOwner() )
     253//   {
     254//     (NetworkGameManager::getInstance())->sync( this->getUniqueID(), this->getOwner() );
     255//     setRequestedSync( true );
     256//   }
     257//
     258//   int rec = this->getRequestSync();
     259//   if ( rec > 0 )
     260//   {
     261//     *reciever = rec;
     262//
     263//     SYNCHELP_WRITE_FKT( WorldEntity::readState );
     264//
     265//   }
     266//
     267//   *reciever = 0;
     268//   return SYNCHELP_WRITE_N;
     269}
  • branches/network/src/world_entities/environments/water.h

    r6518 r6685  
    3535   void tick(float dt);
    3636
     37   virtual int writeBytes(const byte* data, int length, int sender);
     38   virtual int readBytes(byte* data, int maxLength, int * reciever);
     39
     40
    3741  private:
    3842    Grid*           grid;            //!< The water-surface-model to render with
Note: See TracChangeset for help on using the changeset viewer.