Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 6, 2006, 6:41:59 PM (19 years ago)
Author:
rennerc
Message:

tried to place ParamPowerUp

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  
    2525#include "factory.h"
    2626#include "load_param.h"
     27#include "network_game_manager.h"
    2728
    2829using namespace std;
     
    119120}
    120121
     122int ParamPowerUp::writeBytes( const byte * data, int length, int sender )
     123{
     124  setRequestedSync( false );
     125  setIsOutOfSync( false );
    121126
     127  SYNCHELP_READ_BEGIN();
     128
     129  SYNCHELP_READ_FKT( PowerUp::writeState );
     130
     131  return SYNCHELP_READ_N;
     132}
     133
     134
     135
     136int 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  
    3030  int getValue();
    3131
     32  virtual int writeBytes(const byte* data, int length, int sender);
     33  virtual int readBytes(byte* data, int maxLength, int * reciever );
     34
    3235protected:
    3336  virtual void respawn();
Note: See TracChangeset for help on using the changeset viewer.