Changeset 7161 for code/branches/presentation3/src/orxonox/gamestates
- Timestamp:
- Jul 28, 2010, 8:29:32 PM (14 years ago)
- Location:
- code/branches/presentation3/src/orxonox/gamestates
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation3/src/orxonox/gamestates/GSClient.cc
r7122 r7161 44 44 GSClient::GSClient(const GameStateInfo& info) 45 45 : GameState(info) 46 , client_(0)47 46 { 48 47 } … … 56 55 GameMode::setIsClient(true); 57 56 58 this->client_ = new Client(CommandLineParser::getValue("dest").getString(), CommandLineParser::getValue("port")); 57 // this->client_ = new Client(); 58 // this->client_->setDestination(CommandLineParser::getValue("dest").getString(), CommandLineParser::getValue("port") ); 59 59 60 if( !client_->establishConnection())60 if( !Client::getInstance()->establishConnection() ) 61 61 { 62 delete this->client_;63 62 ThrowException(InitialisationFailed, "Could not establish connection with server."); 64 63 } 65 64 66 client_->update(Game::getInstance().getGameClock());65 Client::getInstance()->update(Game::getInstance().getGameClock()); 67 66 } 68 67 69 68 void GSClient::deactivate() 70 69 { 71 client_->closeConnection();70 Client::getInstance()->closeConnection(); 72 71 73 72 // destroy client 74 delete this->client_;73 // delete this->client_; 75 74 76 75 GameMode::setIsClient(false); … … 79 78 void GSClient::update(const Clock& time) 80 79 { 81 client_->update(time);80 Client::getInstance()->update(time); 82 81 } 83 82 } -
code/branches/presentation3/src/orxonox/gamestates/GSClient.h
r5929 r7161 46 46 void deactivate(); 47 47 void update(const Clock& time); 48 49 private:50 Client* client_;51 48 }; 52 49 }
Note: See TracChangeset
for help on using the changeset viewer.