Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1669


Ignore:
Timestamp:
Aug 26, 2008, 1:19:21 AM (16 years ago)
Author:
scheusso
Message:

forgot something ;)

Location:
code/branches/network/src
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/orxonox/Orxonox.cc

    r1577 r1669  
    126126    GraphicsEngine::getSingleton().destroy();
    127127
    128     if (network::Client::getSingleton())
    129       network::Client::destroySingleton();
     128    if (client_g)
     129      delete client_g;
    130130    if (server_g)
    131       delete network::Server::getSingleton();
     131      delete server_g;
    132132  }
    133133
     
    346346    COUT(0) << "Loading level in server mode" << std::endl;
    347347
    348     //server_g = new network::Server(serverPort_);
    349     server_g = network::Server::createSingleton(serverPort_);
    350 
     348    server_g = new network::Server(serverPort_);
     349    COUT(0) << "Loading scene in server mode" << std::endl;
    351350    if (!loadScene())
    352351      return false;
     
    365364
    366365    if (serverIp_.compare("") == 0)
    367       client_g = network::Client::createSingleton();
     366      client_g = new network::Client();
    368367    else
    369368
    370       client_g = network::Client::createSingleton(serverIp_, serverPort_);
     369      client_g = new network::Client(serverIp_, serverPort_);
    371370
    372371    if(!client_g->establishConnection())
     
    509508
    510509    if (mode_ == CLIENT)
    511       network::Client::getSingleton()->closeConnection();
     510      client_g->closeConnection();
    512511    else if (mode_ == SERVER)
    513512      server_g->close();
  • code/branches/network/src/orxonox/objects/SpaceShip.cc

    r1564 r1669  
    4848#include "core/XMLPort.h"
    4949#include "core/ConsoleCommand.h"
    50 #include "network/Client.h"
     50#include "network/Host.h"
    5151#include "hud/HUD.h"
    5252
     
    158158    bool SpaceShip::create(){
    159159      if(!myShip_){
    160         if(network::Client::getSingleton() && objectID == network::Client::getSingleton()->getShipID())
     160        if(network::Host::running() && objectID == network::Host::getShipID())
    161161          myShip_=true;
    162162        else
     
    282282    void SpaceShip::setCamera(const std::string& camera)
    283283    {
    284       myShip_=true; // TODO: this is only a hack
    285284      camName_=camera;
    286285      // change camera attributes here, if you want to ;)
     
    289288    void SpaceShip::getFocus(){
    290289      COUT(4) << "requesting focus" << std::endl;
    291       if(network::Client::getSingleton()==0 || network::Client::getSingleton()->getShipID()==objectID)
     290      //if(!network::Host::running() || network::Host::getShipID()==objectID)
     291      if(myShip_)
    292292        CameraHandler::getInstance()->requestFocus(cam_);
    293293
     
    311311      cam_->setTargetNode(this->getNode());
    312312//        cam->setPosition(Vector3(0,-350,0));
     313//      Quaternion q1 = Quaternion(Radian(Degree(90)),Vector3(0,0,1));
     314//      Quaternion q2 = Quaternion(Radian(Degree(90)),Vector3(0,1,0));
    313315      Quaternion q1 = Quaternion(Radian(Degree(90)),Vector3(0,-1,0));
    314316      Quaternion q2 = Quaternion(Radian(Degree(90)),Vector3(1,0,0));
    315       this->camNode_->setOrientation(q2*q1);
    316       if(network::Client::getSingleton()!=0 && network::Client::getSingleton()->getShipID()==objectID){
     317
     318       this->camNode_->setOrientation(q2*q1);
     319      //if(!network::Host::running() || network::Host::getShipID()==objectID){ //TODO: check this
     320      if(myShip_){
     321        COUT(3) << "requesting focus for camera" << std::endl;
    317322        this->setBacksync(true);
    318         CameraHandler::getInstance()->requestFocus(cam_);
     323        //CameraHandler::getInstance()->requestFocus(cam_);
     324        if(this->isExactlyA(Class(SpaceShip)))
     325          getFocus();
    319326      }
    320327
     
    355362        XMLPortParamLoadOnly(SpaceShip, "rotDamp", setRotDamp, xmlelement, mode);
    356363
     364        myShip_=true; //TODO: this is a hack
    357365        SpaceShip::create();
    358         if (this->isExactlyA(Class(SpaceShip)))
    359             getFocus();
     366        /*if (this->isExactlyA(Class(SpaceShip)))
     367            getFocus();*/
    360368    }
    361369
  • code/branches/network/src/util/CMakeLists.txt

    r1505 r1669  
    11SET(UTIL_SRC_FILES
    22  ArgReader.cc
     3  Bytestream.cc
    34  Clipboard.cc
    45  ExprParser.cc
  • code/branches/network/src/util/UtilPrereqs.h

    r1505 r1669  
    6161//-----------------------------------------------------------------------
    6262class ArgReader;
     63class Bytestream;
    6364class Convert;
    6465class MultiTypePrimitive;
     
    6869class String2Number;
    6970class SubString;
    70 
    7171#endif /* _UtilPrereqs_H__ */
Note: See TracChangeset for help on using the changeset viewer.