Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 22, 2008, 11:54:48 AM (16 years ago)
Author:
scheusso
Message:

most coding is done, still testing now
types should get transfered in platform independent formats now

Location:
code/branches/network64/src/orxonox/objects
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network64/src/orxonox/objects/Level.cc

    r2171 r2245  
    8383    void Level::registerVariables()
    8484    {
    85         REGISTERSTRING(this->xmlfilename_, direction::toclient, new NetworkCallback<Level>(this, &Level::networkcallback_applyXMLFile));
    86         REGISTERSTRING(this->name_,        direction::toclient, new NetworkCallback<Level>(this, &Level::changedName));
    87         REGISTERSTRING(this->description_, direction::toclient);
     85        registerVariable(this->xmlfilename_, variableDirection::toclient, new NetworkCallback<Level>(this, &Level::networkcallback_applyXMLFile));
     86        registerVariable(this->name_,        variableDirection::toclient, new NetworkCallback<Level>(this, &Level::changedName));
     87        registerVariable(this->description_, variableDirection::toclient);
    8888    }
    8989
  • code/branches/network64/src/orxonox/objects/Scene.cc

    r2171 r2245  
    114114    void Scene::registerVariables()
    115115    {
    116         REGISTERSTRING(this->skybox_,     direction::toclient, new NetworkCallback<Scene>(this, &Scene::networkcallback_applySkybox));
    117         REGISTERDATA(this->ambientLight_, direction::toclient, new NetworkCallback<Scene>(this, &Scene::networkcallback_applyAmbientLight));
     116        registerVariable(this->skybox_,     variableDirection::toclient, new NetworkCallback<Scene>(this, &Scene::networkcallback_applySkybox));
     117        registerVariable(this->ambientLight_, variableDirection::toclient, new NetworkCallback<Scene>(this, &Scene::networkcallback_applyAmbientLight));
    118118    }
    119119
  • code/branches/network64/src/orxonox/objects/Test.cc

    r2171 r2245  
    7070        void Test::registerVariables()
    7171        {
    72                 REGISTERDATA ( v1,direction::toclient, new NetworkCallback<Test> ( this, &Test::checkV1 ) );
    73     REGISTERDATA ( v2,direction::toserver, new NetworkCallback<Test> ( this, &Test::checkV2 ) );
    74                 REGISTERDATA ( v3,direction::serverMaster, new NetworkCallback<Test> ( this, &Test::checkV3 ) );
    75     REGISTERDATA ( v4,direction::clientMaster, new NetworkCallback<Test> ( this, &Test::checkV4 ) );
     72                registerVariable ( v1, variableDirection::toclient, new NetworkCallback<Test> ( this, &Test::checkV1 ));
     73    registerVariable ( v2, variableDirection::toserver, new NetworkCallback<Test> ( this, &Test::checkV2 ));
     74                registerVariable ( v3, variableDirection::serverMaster, new NetworkCallback<Test> ( this, &Test::checkV3 ), true );
     75    registerVariable ( v4, variableDirection::clientMaster, new NetworkCallback<Test> ( this, &Test::checkV4 ), true );
    7676        }
    7777
  • code/branches/network64/src/orxonox/objects/Test.h

    r2211 r2245  
    5555      void checkV4();
    5656     
    57       void printV1(){ instance_->checkV1(); }
    58       void printV2(){ instance_->checkV2(); }
    59       void printV3(){ instance_->checkV3(); }
    60       void printV4(){ instance_->checkV4(); }
     57      static void printV1(){ instance_->checkV1(); }
     58      static void printV2(){ instance_->checkV2(); }
     59      static void printV3(){ instance_->checkV3(); }
     60      static void printV4(){ instance_->checkV4(); }
    6161
    6262    private:
  • code/branches/network64/src/orxonox/objects/infos/HumanPlayer.cc

    r2171 r2245  
    6767    void HumanPlayer::registerVariables()
    6868    {
    69         REGISTERSTRING(this->synchronize_nick_, direction::toserver, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_changednick));
     69        registerVariable(this->synchronize_nick_, variableDirection::toserver, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_changednick));
    7070
    71         REGISTERDATA(this->clientID_,     direction::toclient, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_clientIDchanged));
    72         REGISTERDATA(this->server_initialized_, direction::toclient, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_server_initialized));
    73         REGISTERDATA(this->client_initialized_, direction::toserver, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_client_initialized));
     71        registerVariable(this->clientID_,     variableDirection::toclient, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_clientIDchanged));
     72        registerVariable(this->server_initialized_, variableDirection::toclient, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_server_initialized));
     73        registerVariable(this->client_initialized_, variableDirection::toserver, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_client_initialized));
    7474    }
    7575
     
    9999
    100100            if (!Core::isMaster())
    101                 this->setObjectMode(direction::bidirectional);
     101                this->setObjectMode(objectDirection::bidirectional);
    102102            else
    103103                this->setName(this->nick_);
  • code/branches/network64/src/orxonox/objects/infos/PlayerInfo.cc

    r2171 r2245  
    6969    void PlayerInfo::registerVariables()
    7070    {
    71         REGISTERSTRING(this->name_,                 direction::toclient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::changedName));
    72         REGISTERDATA  (this->controllableEntityID_, direction::toclient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::networkcallback_changedcontrollableentityID));
    73         REGISTERDATA  (this->bReadyToSpawn_,        direction::toserver);
     71        registerVariable(this->name_,                 variableDirection::toclient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::changedName));
     72        registerVariable(this->controllableEntityID_, variableDirection::toclient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::networkcallback_changedcontrollableentityID));
     73        registerVariable(this->bReadyToSpawn_,        variableDirection::toserver);
    7474    }
    7575
  • code/branches/network64/src/orxonox/objects/worldentities/Billboard.cc

    r2171 r2245  
    6464    void Billboard::registerVariables()
    6565    {
    66         REGISTERSTRING(this->material_, direction::toclient, new NetworkCallback<Billboard>(this, &Billboard::changedMaterial));
    67         REGISTERDATA  (this->colour_,   direction::toclient, new NetworkCallback<Billboard>(this, &Billboard::changedColour));
     66        registerVariable(this->material_, variableDirection::toclient, new NetworkCallback<Billboard>(this, &Billboard::changedMaterial));
     67        registerVariable(this->colour_,   variableDirection::toclient, new NetworkCallback<Billboard>(this, &Billboard::changedColour));
    6868    }
    6969
  • code/branches/network64/src/orxonox/objects/worldentities/ControllableEntity.cc

    r2171 r2245  
    165165                this->client_overwrite_ = this->server_overwrite_;
    166166COUT(0) << "CE: bidirectional synchronization" << std::endl;
    167                 this->setObjectMode(direction::bidirectional);
     167                this->setObjectMode(objectDirection::bidirectional);
    168168            }
    169169        }
     
    178178        this->playerID_ = OBJECTID_UNKNOWN;
    179179        this->bControlled_ = false;
    180         this->setObjectMode(direction::toclient);
     180        this->setObjectMode(objectDirection::toclient);
    181181
    182182        if (this->bDestroyWhenPlayerLeft_)
     
    248248    void ControllableEntity::registerVariables()
    249249    {
    250         REGISTERSTRING(this->cameraPositionTemplate_, direction::toclient);
    251 
    252         REGISTERDATA(this->client_overwrite_,   direction::toserver);
    253        
    254         REGISTERDATA(this->server_position_,    direction::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerPosition));
    255         REGISTERDATA(this->server_velocity_,    direction::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerVelocity));
    256         REGISTERDATA(this->server_orientation_, direction::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerOrientation));
    257         REGISTERDATA(this->server_overwrite_,   direction::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processOverwrite));
    258 
    259         REGISTERDATA(this->client_position_,    direction::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientPosition));
    260         REGISTERDATA(this->client_velocity_,    direction::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientVelocity));
    261         REGISTERDATA(this->client_orientation_, direction::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientOrientation));
    262 
    263 
    264         REGISTERDATA(this->playerID_, direction::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::networkcallback_changedplayerID));
     250        registerVariable(this->cameraPositionTemplate_, variableDirection::toclient);
     251 
     252        registerVariable(this->client_overwrite_,   variableDirection::toserver);
     253         
     254        registerVariable(this->server_position_,    variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerPosition));
     255        registerVariable(this->server_velocity_,    variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerVelocity));
     256        registerVariable(this->server_orientation_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerOrientation));
     257        registerVariable(this->server_overwrite_,   variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processOverwrite));
     258 
     259        registerVariable(this->client_position_,    variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientPosition));
     260        registerVariable(this->client_velocity_,    variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientVelocity));
     261        registerVariable(this->client_orientation_, variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientOrientation));
     262 
     263 
     264        registerVariable(this->playerID_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::networkcallback_changedplayerID));
    265265    }
    266266
  • code/branches/network64/src/orxonox/objects/worldentities/Light.cc

    r2171 r2245  
    7979    void Light::registerVariables()
    8080    {
    81         REGISTERDATA(this->type_, direction::toclient, new NetworkCallback<Light>(this, &Light::changedType));
    82         REGISTERDATA(this->light_->getDiffuseColour(), direction::toclient);
    83         REGISTERDATA(this->light_->getSpecularColour(), direction::toclient);
    84         REGISTERDATA(this->light_->getDirection(), direction::toclient);
     81        registerVariable((int &)this->type_, variableDirection::toclient, new NetworkCallback<Light>(this, &Light::changedType));
     82        registerVariable(this->light_->getDiffuseColour(), variableDirection::toclient);
     83        registerVariable(this->light_->getSpecularColour(), variableDirection::toclient);
     84        registerVariable(this->light_->getDirection(), variableDirection::toclient);
    8585    }
    8686
  • code/branches/network64/src/orxonox/objects/worldentities/Model.cc

    r2171 r2245  
    6161    void Model::registerVariables()
    6262    {
    63         REGISTERSTRING(this->meshSrc_,    direction::toclient, new NetworkCallback<Model>(this, &Model::changedMesh));
    64         REGISTERDATA(this->bCastShadows_, direction::toclient, new NetworkCallback<Model>(this, &Model::changedShadows));
     63        registerVariable(this->meshSrc_,    variableDirection::toclient, new NetworkCallback<Model>(this, &Model::changedMesh));
     64        registerVariable(this->bCastShadows_, variableDirection::toclient, new NetworkCallback<Model>(this, &Model::changedShadows));
    6565    }
    6666
  • code/branches/network64/src/orxonox/objects/worldentities/MovableEntity.cc

    r2171 r2245  
    8484    void MovableEntity::registerVariables()
    8585    {
    86         REGISTERDATA(this->velocity_.x, direction::toclient);
    87         REGISTERDATA(this->velocity_.y, direction::toclient);
    88         REGISTERDATA(this->velocity_.z, direction::toclient);
    89 
    90         REGISTERDATA(this->rotationAxis_.x, direction::toclient);
    91         REGISTERDATA(this->rotationAxis_.y, direction::toclient);
    92         REGISTERDATA(this->rotationAxis_.z, direction::toclient);
    93 
    94         REGISTERDATA(this->rotationRate_, direction::toclient);
    95 
    96         REGISTERDATA(this->overwrite_position_,    direction::toclient, new NetworkCallback<MovableEntity>(this, &MovableEntity::overwritePosition));
    97         REGISTERDATA(this->overwrite_orientation_, direction::toclient, new NetworkCallback<MovableEntity>(this, &MovableEntity::overwriteOrientation));
     86        registerVariable(this->velocity_.x, variableDirection::toclient);
     87        registerVariable(this->velocity_.y, variableDirection::toclient);
     88        registerVariable(this->velocity_.z, variableDirection::toclient);
     89 
     90        registerVariable(this->rotationAxis_.x, variableDirection::toclient);
     91        registerVariable(this->rotationAxis_.y, variableDirection::toclient);
     92        registerVariable(this->rotationAxis_.z, variableDirection::toclient);
     93 
     94        registerVariable(this->rotationRate_, variableDirection::toclient);
     95 
     96        registerVariable(this->overwrite_position_,    variableDirection::toclient, new NetworkCallback<MovableEntity>(this, &MovableEntity::overwritePosition));
     97        registerVariable(this->overwrite_orientation_, variableDirection::toclient, new NetworkCallback<MovableEntity>(this, &MovableEntity::overwriteOrientation));
    9898    }
    9999
  • code/branches/network64/src/orxonox/objects/worldentities/ParticleEmitter.cc

    r2171 r2245  
    7575    void ParticleEmitter::registerVariables()
    7676    {
    77         REGISTERSTRING(this->source_, direction::toclient, new NetworkCallback<ParticleEmitter>(this, &ParticleEmitter::sourceChanged));
    78         REGISTERDATA  (this->LOD_,    direction::toclient, new NetworkCallback<ParticleEmitter>(this, &ParticleEmitter::LODchanged));
     77        registerVariable(this->source_, variableDirection::toclient, new NetworkCallback<ParticleEmitter>(this, &ParticleEmitter::sourceChanged));
     78        registerVariable((int&)(this->LOD_),    variableDirection::toclient, new NetworkCallback<ParticleEmitter>(this, &ParticleEmitter::LODchanged));
    7979    }
    8080
  • code/branches/network64/src/orxonox/objects/worldentities/PositionableEntity.cc

    r2171 r2245  
    4848    void PositionableEntity::registerVariables()
    4949    {
    50         REGISTERDATA(this->getPosition().x, direction::toclient);
    51         REGISTERDATA(this->getPosition().y, direction::toclient);
    52         REGISTERDATA(this->getPosition().z, direction::toclient);
     50        registerVariable(this->getPosition().x, variableDirection::toclient);
     51        registerVariable(this->getPosition().y, variableDirection::toclient);
     52        registerVariable(this->getPosition().z, variableDirection::toclient);
    5353
    54         REGISTERDATA(this->getOrientation().w, direction::toclient);
    55         REGISTERDATA(this->getOrientation().x, direction::toclient);
    56         REGISTERDATA(this->getOrientation().y, direction::toclient);
    57         REGISTERDATA(this->getOrientation().z, direction::toclient);
     54        registerVariable(this->getOrientation().w, variableDirection::toclient);
     55        registerVariable(this->getOrientation().x, variableDirection::toclient);
     56        registerVariable(this->getOrientation().y, variableDirection::toclient);
     57        registerVariable(this->getOrientation().z, variableDirection::toclient);
    5858    }
    5959}
  • code/branches/network64/src/orxonox/objects/worldentities/WorldEntity.cc

    r2171 r2245  
    9696    void WorldEntity::registerVariables()
    9797    {
    98         REGISTERDATA(this->bActive_,  direction::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedActivity));
    99         REGISTERDATA(this->bVisible_, direction::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedVisibility));
    100 
    101         REGISTERDATA(this->getScale3D().x, direction::toclient);
    102         REGISTERDATA(this->getScale3D().y, direction::toclient);
    103         REGISTERDATA(this->getScale3D().z, direction::toclient);
    104 
    105         REGISTERDATA(this->parentID_, direction::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::updateParent));
     98        registerVariable(this->bActive_,  variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedActivity));
     99        registerVariable(this->bVisible_, variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedVisibility));
     100 
     101        registerVariable(this->getScale3D().x, variableDirection::toclient);
     102        registerVariable(this->getScale3D().y, variableDirection::toclient);
     103        registerVariable(this->getScale3D().z, variableDirection::toclient);
     104 
     105        registerVariable(this->parentID_, variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::updateParent));
    106106    }
    107107
  • code/branches/network64/src/orxonox/objects/worldentities/pawns/Pawn.cc

    r2171 r2245  
    8080    void Pawn::registerVariables()
    8181    {
    82         REGISTERDATA(this->bAlive_, direction::toclient);
    83         REGISTERDATA(this->health_, direction::toclient);
     82        registerVariable(this->bAlive_, variableDirection::toclient);
     83        registerVariable(this->health_, variableDirection::toclient);
    8484    }
    8585
  • code/branches/network64/src/orxonox/objects/worldentities/pawns/SpaceShip.cc

    r2171 r2245  
    8282    void SpaceShip::registerVariables()
    8383    {
    84         REGISTERDATA(this->maxSpeed_,                direction::toclient);
    85         REGISTERDATA(this->maxSecondarySpeed_,       direction::toclient);
    86         REGISTERDATA(this->maxRotation_,             direction::toclient);
    87         REGISTERDATA(this->translationAcceleration_, direction::toclient);
    88         REGISTERDATA(this->rotationAcceleration_,    direction::toclient);
    89         REGISTERDATA(this->translationDamping_,      direction::toclient);
     84        registerVariable(this->maxSpeed_,                variableDirection::toclient);
     85        registerVariable(this->maxSecondarySpeed_,       variableDirection::toclient);
     86        registerVariable(this->maxRotation_,             variableDirection::toclient);
     87        registerVariable(this->translationAcceleration_, variableDirection::toclient);
     88        registerVariable(this->rotationAcceleration_,    variableDirection::toclient);
     89        registerVariable(this->translationDamping_,      variableDirection::toclient);
    9090    }
    9191
  • code/branches/network64/src/orxonox/objects/worldentities/pawns/Spectator.cc

    r2171 r2245  
    8686    void Spectator::registerVariables()
    8787    {
    88         REGISTERDATA(this->bGreetingFlareVisible_, direction::toclient, new NetworkCallback<Spectator>(this, &Spectator::changedFlareVisibility));
    89         REGISTERDATA(this->bGreeting_,             direction::toserver, new NetworkCallback<Spectator>(this, &Spectator::changedGreeting));
    90         REGISTERDATA(this->hudmode_,               direction::toclient);
     88        registerVariable(this->bGreetingFlareVisible_, variableDirection::toclient, new NetworkCallback<Spectator>(this, &Spectator::changedFlareVisibility));
     89        registerVariable(this->bGreeting_,             variableDirection::toserver, new NetworkCallback<Spectator>(this, &Spectator::changedGreeting));
     90        registerVariable(this->hudmode_,               variableDirection::toclient);
    9191    }
    9292
Note: See TracChangeset for help on using the changeset viewer.