Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 12, 2008, 7:40:47 PM (16 years ago)
Author:
scheusso
Message:

merged network branch back to trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/objects/SpaceShip.cc

    r1789 r1907  
    7878      for(it = ObjectList<SpaceShip>::begin(); it; ++it){
    7979        assert(it->isA(Class(SpaceShip)));
    80         if( (it)->myShip_ || (network::Host::running() && network::Host::getShipID()==(it)->objectID) ){
     80        if( (it)->myShip_ || (network::Host::running() && network::Host::getShipID()==(it)->getObjectID()) ){
    8181//        COUT(1) << "^^^^^^^^^^ myShip_:" << *it << " classname: " << (*it)->getIdentifier()->getName() << " objectid: " << (*it)->objectID << std::endl;
    8282          return *it;
     
    173173        if (!myShip_)
    174174        {
    175             if (network::Host::running())
    176                 //COUT(3) << "this id: " << this->objectID << " myShipID: " << network::Host::getShipID() << std::endl;
    177                 if (network::Host::running() && objectID == network::Host::getShipID())
    178                 {
    179                     if (!network::Host::isServer())
    180                         setObjectMode(0x3);
    181                     myShip_ = true;
    182                 }
    183         }
    184         else
    185             this->setRadarObjectColour(this->getProjectileColour());
    186         assert(Model::create());
    187         this->init();
    188         return true;
     175            if (network::Host::running() && getObjectID() == network::Host::getShipID())
     176            {
     177                if (!network::Host::isServer())
     178                    setObjectMode(0x3);
     179                myShip_ = true;
     180            }
     181            else
     182                this->setRadarObjectColour(this->getProjectileColour());
     183      }
     184      Model::create();
     185      this->init();
     186      return true;
    189187    }
    190188
     
    258256
    259257            // START CREATING ADDITIONAL EFFECTS
    260             /*this->backlight_ = new Backlight(this->maxSpeed_, 0.8);
    261             this->attachObject(this->backlight_);
    262             this->backlight_->setPosition(-2.35, 0, 0.2);
    263             this->backlight_->setColour(this->getProjectileColour());
    264 
    265             this->smoke_ = new ParticleSpawner();
    266             this->smoke_->setParticle("Orxonox/smoke5", LODParticle::normal, 0, 0, 3);
    267             this->attachObject(this->smoke_);
    268 
    269             this->fire_ = new ParticleSpawner();
    270             this->fire_->setParticle("Orxonox/fire3", LODParticle::normal, 0, 0, 1);
    271             this->attachObject(this->fire_);
    272             */
     258            if(!network::Host::running()){
     259              this->backlight_ = new Backlight(this->maxSpeed_, 0.8);
     260              this->backlight_->create();
     261              this->attachObject(this->backlight_);
     262              this->backlight_->setPosition(-2.35, 0, 0.2);
     263              this->backlight_->setColour(this->getProjectileColour());
     264 
     265              this->smoke_ = new ParticleSpawner();
     266              this->smoke_->setParticle("Orxonox/smoke5", LODParticle::normal, 0, 0, 3);
     267              this->attachObject(this->smoke_);
     268 
     269              this->fire_ = new ParticleSpawner();
     270              this->fire_->setParticle("Orxonox/fire3", LODParticle::normal, 0, 0, 1);
     271              this->attachObject(this->fire_);
     272            }
     273           
    273274            // END CREATING ADDITIONAL EFFECTS
    274275
     
    374375      //if(!network::Host::running() || network::Host::getShipID()==objectID){ //TODO: check this
    375376      if(myShip_){
    376         COUT(4) << "requesting focus for camera" << std::endl;
     377        COUT(5) << "requesting focus for camera" << std::endl;
    377378        //CameraHandler::getInstance()->requestFocus(cam_);
    378379        if(this->isExactlyA(Class(SpaceShip))){
    379380          getFocus();
    380           COUT(4) << "getting focus for obj id: " << objectID << std::endl;
     381          COUT(4) << "getting focus for obj id: " << getObjectID() << std::endl;
    381382        }else
    382           COUT(4) << "not getting focus (not exactly spaceship) for obj id: " << objectID << std::endl;
     383          COUT(5) << "not getting focus (not exactly spaceship) for obj id: " << getObjectID() << std::endl;
    383384      }else
    384         COUT(4) << "not getting focus (not my ship) for obj id: " << objectID << std::endl;
     385        COUT(5) << "not getting focus (not my ship) for obj id: " << getObjectID() << std::endl;
    385386    }
    386387
     
    478479            projectile->setColour(this->getProjectileColour());
    479480            projectile->create();
    480             if (projectile->classID == 0)
     481            if (projectile->getClassID() == 0)
    481482            {
    482483              COUT(3) << "generated projectile with classid 0" <<  std::endl; // TODO: remove this output
     
    573574        }
    574575
    575         COUT(5) << "steering our ship: " << objectID << std::endl;
     576        COUT(5) << "steering our ship: " << getObjectID() << std::endl;
    576577        this->acceleration_.x = 0;
    577578        this->acceleration_.y = 0;
Note: See TracChangeset for help on using the changeset viewer.