- Timestamp:
- Apr 8, 2009, 12:36:08 AM (15 years ago)
- Location:
- code/branches/questsystem5
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem5
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/gamestates/GSClient.cc
r2171 r2907 31 31 32 32 #include "core/input/InputManager.h" 33 #include "core/Clock.h" 33 34 #include "core/CommandLine.h" 34 #include "core/Core.h" 35 #include "core/Game.h" 36 #include "core/GameMode.h" 35 37 #include "network/Client.h" 36 38 37 39 namespace orxonox 38 40 { 41 AddGameState(GSClient, "client"); 42 39 43 SetCommandLineArgument(ip, "127.0.0.1").information("#.#.#.#"); 40 44 41 GSClient::GSClient( )42 : GameState <GSGraphics>("client")45 GSClient::GSClient(const std::string& name) 46 : GameState(name) 43 47 , client_(0) 44 48 { … … 49 53 } 50 54 51 void GSClient:: enter()55 void GSClient::activate() 52 56 { 53 Core::setIsClient(true);57 GameMode::setIsClient(true); 54 58 55 59 this->client_ = new Client(CommandLine::getValue("ip").getString(), CommandLine::getValue("port")); … … 58 62 ThrowException(InitialisationFailed, "Could not establish connection with server."); 59 63 60 GSLevel::enter(this->getParent()->getViewport()); 61 62 client_->tick(0); 64 client_->update(Game::getInstance().getGameClock()); 63 65 } 64 66 65 void GSClient:: leave()67 void GSClient::deactivate() 66 68 { 67 GSLevel::leave();68 69 69 client_->closeConnection(); 70 70 … … 72 72 delete this->client_; 73 73 74 Core::setIsClient(false);74 GameMode::setIsClient(false); 75 75 } 76 76 77 void GSClient:: ticked(const Clock& time)77 void GSClient::update(const Clock& time) 78 78 { 79 GSLevel::ticked(time); 80 client_->tick(time.getDeltaTime()); 81 82 this->tickChild(time); 79 client_->update(time); 83 80 } 84 81 }
Note: See TracChangeset
for help on using the changeset viewer.