Changeset 1669
- Timestamp:
- Aug 26, 2008, 1:19:21 AM (16 years ago)
- Location:
- code/branches/network/src
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/src/orxonox/Orxonox.cc
r1577 r1669 126 126 GraphicsEngine::getSingleton().destroy(); 127 127 128 if ( network::Client::getSingleton())129 network::Client::destroySingleton();128 if (client_g) 129 delete client_g; 130 130 if (server_g) 131 delete network::Server::getSingleton();131 delete server_g; 132 132 } 133 133 … … 346 346 COUT(0) << "Loading level in server mode" << std::endl; 347 347 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; 351 350 if (!loadScene()) 352 351 return false; … … 365 364 366 365 if (serverIp_.compare("") == 0) 367 client_g = ne twork::Client::createSingleton();366 client_g = new network::Client(); 368 367 else 369 368 370 client_g = ne twork::Client::createSingleton(serverIp_, serverPort_);369 client_g = new network::Client(serverIp_, serverPort_); 371 370 372 371 if(!client_g->establishConnection()) … … 509 508 510 509 if (mode_ == CLIENT) 511 network::Client::getSingleton()->closeConnection();510 client_g->closeConnection(); 512 511 else if (mode_ == SERVER) 513 512 server_g->close(); -
code/branches/network/src/orxonox/objects/SpaceShip.cc
r1564 r1669 48 48 #include "core/XMLPort.h" 49 49 #include "core/ConsoleCommand.h" 50 #include "network/ Client.h"50 #include "network/Host.h" 51 51 #include "hud/HUD.h" 52 52 … … 158 158 bool SpaceShip::create(){ 159 159 if(!myShip_){ 160 if(network:: Client::getSingleton() && objectID == network::Client::getSingleton()->getShipID())160 if(network::Host::running() && objectID == network::Host::getShipID()) 161 161 myShip_=true; 162 162 else … … 282 282 void SpaceShip::setCamera(const std::string& camera) 283 283 { 284 myShip_=true; // TODO: this is only a hack285 284 camName_=camera; 286 285 // change camera attributes here, if you want to ;) … … 289 288 void SpaceShip::getFocus(){ 290 289 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_) 292 292 CameraHandler::getInstance()->requestFocus(cam_); 293 293 … … 311 311 cam_->setTargetNode(this->getNode()); 312 312 // 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)); 313 315 Quaternion q1 = Quaternion(Radian(Degree(90)),Vector3(0,-1,0)); 314 316 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; 317 322 this->setBacksync(true); 318 CameraHandler::getInstance()->requestFocus(cam_); 323 //CameraHandler::getInstance()->requestFocus(cam_); 324 if(this->isExactlyA(Class(SpaceShip))) 325 getFocus(); 319 326 } 320 327 … … 355 362 XMLPortParamLoadOnly(SpaceShip, "rotDamp", setRotDamp, xmlelement, mode); 356 363 364 myShip_=true; //TODO: this is a hack 357 365 SpaceShip::create(); 358 if (this->isExactlyA(Class(SpaceShip)))359 getFocus(); 366 /*if (this->isExactlyA(Class(SpaceShip))) 367 getFocus();*/ 360 368 } 361 369 -
code/branches/network/src/util/CMakeLists.txt
r1505 r1669 1 1 SET(UTIL_SRC_FILES 2 2 ArgReader.cc 3 Bytestream.cc 3 4 Clipboard.cc 4 5 ExprParser.cc -
code/branches/network/src/util/UtilPrereqs.h
r1505 r1669 61 61 //----------------------------------------------------------------------- 62 62 class ArgReader; 63 class Bytestream; 63 64 class Convert; 64 65 class MultiTypePrimitive; … … 68 69 class String2Number; 69 70 class SubString; 70 71 71 #endif /* _UtilPrereqs_H__ */
Note: See TracChangeset
for help on using the changeset viewer.