Changeset 1732
- Timestamp:
- Sep 7, 2008, 4:33:09 PM (16 years ago)
- Location:
- code/branches/network/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/src/network/Client.h
r1711 r1732 80 80 unsigned int shipID(){return shipID_;} 81 81 int playerID(){return clientID_;} 82 static void setShipID( unsigned int shipID){ dynamic_cast<Client *>(instance_)->shipID_=shipID; }82 //static void setShipID( unsigned int shipID){ dynamic_cast<Client *>(instance_)->shipID_=shipID; } 83 83 static void setClientID( unsigned int clientID){ dynamic_cast<Client *>(instance_)->clientID_=clientID; } 84 84 -
code/branches/network/src/network/Host.cc
r1711 r1732 48 48 } 49 49 50 unsigned int Host::getShipID(){51 if(!instance_)52 return 0;53 return instance_->shipID();54 }50 // unsigned int Host::getShipID(){ 51 // if(!instance_) 52 // assert(0); 53 // return instance_->shipID(); 54 // } 55 55 56 56 }//namespace network -
code/branches/network/src/network/Host.h
r1711 r1732 61 61 // static bool receiveChat(packet::Chat *message, unsigned int clientID); 62 62 static int getPlayerID(); 63 static unsigned int getShipID() ;63 static unsigned int getShipID(){return instance_->shipID_;} 64 64 static void setClientID(unsigned int id){ instance_->clientID_ = id; } 65 65 static void setShipID(unsigned int id){ instance_->shipID_ = id; } -
code/branches/network/src/network/packet/Welcome.cc
r1713 r1732 32 32 #include "Welcome.h" 33 33 #include "network/Host.h" 34 #include "core/CoreIncludes.h" 34 35 #include <assert.h> 35 36 … … 77 78 Host::setClientID(clientID); 78 79 Host::setShipID(shipID); 80 COUT(3) << "Welcome set clientId: " << clientID << " shipID: " << shipID << std::endl; 79 81 delete this; 80 82 return true; -
code/branches/network/src/orxonox/objects/Ambient.h
r1505 r1732 38 38 namespace orxonox 39 39 { 40 class _OrxonoxExport Ambient : public BaseObject, network::Synchronisable40 class _OrxonoxExport Ambient : public BaseObject, public network::Synchronisable 41 41 { 42 42 public: -
code/branches/network/src/orxonox/objects/SpaceShip.cc
r1730 r1732 76 76 return *it; 77 77 } 78 return NULL;78 return 0; 79 79 } 80 80 … … 158 158 bool SpaceShip::create(){ 159 159 if(!myShip_){ 160 if(network::Host::running()) 161 COUT(3) << "this id: " << this->objectID << " myShipID: " << network::Host::getShipID() << std::endl; 160 162 if(network::Host::running() && objectID == network::Host::getShipID()) 161 163 myShip_=true; … … 163 165 HUD::getSingleton().addRadarObject(this, this->getProjectileColour()); 164 166 } 165 if(Model::create()) 166 this->init(); 167 else 168 return false; 167 assert(Model::create()); 168 this->init(); 169 169 return true; 170 170 } … … 287 287 288 288 void SpaceShip::getFocus(){ 289 COUT( 4) << "requesting focus" << std::endl;289 COUT(3) << "requesting focus" << std::endl; 290 290 //if(!network::Host::running() || network::Host::getShipID()==objectID) 291 291 if(myShip_) … … 301 301 // COUT(4) << "begin camera creation" << std::endl; 302 302 this->camNode_ = this->getNode()->createChildSceneNode(camName_); 303 COUT( 4) << "position: (this)" << this->getNode()->getPosition() << std::endl;303 COUT(3) << "position: (this)" << this->getNode()->getPosition() << std::endl; 304 304 this->camNode_->setPosition(Vector3(-25,0,5)); 305 305 // Quaternion q1 = Quaternion(Radian(Degree(90)),Vector3(0,-1,0));
Note: See TracChangeset
for help on using the changeset viewer.